import type { GeneratedEtsLibFile } from "../../types/generated";

export const FILE: GeneratedEtsLibFile = {
  path: 'ets/api/@ohos.request.d.ts',
  content: "/*\n * Copyright (c) 2022 Huawei Device Co., Ltd.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * @file\n * @kit BasicServicesKit\n */\nimport { AsyncCallback } from './@ohos.base';\nimport { Callback } from './@ohos.base';\nimport BaseContext from './application/BaseContext';\n/**\n * Upload and download\n *\n * @namespace request\n * @since 6\n */\n/**\n * Upload and download\n *\n * @namespace request\n * @syscap SystemCapability.Request.FileTransferAgent\n * @crossplatform\n * @since 10\n */\n/**\n * Upload and download\n *\n * @namespace request\n * @syscap SystemCapability.Request.FileTransferAgent\n * @crossplatform\n * @atomicservice\n * @since 11\n */\ndeclare namespace request {\n    /**\n     * Error code 201 - The permissions check fails.\n     *\n     * @syscap SystemCapability.MiscServices.Download\n     * @since 9\n     */\n    /**\n     * Error code 201 - The permissions check fails.\n     *\n     * @syscap SystemCapability.MiscServices.Download\n     * @crossplatform\n     * @since 10\n     */\n    const EXCEPTION_PERMISSION: number;\n    /**\n     * Error code 401 - The parameters check fails.\n     *\n     * @syscap SystemCapability.MiscServices.Download\n     * @since 9\n     */\n    /**\n     * Error code 401 - The parameters check fails.\n     *\n     * @syscap SystemCapability.MiscServices.Download\n     * @crossplatform\n     * @since 10\n     */\n    const EXCEPTION_PARAMCHECK: number;\n    /**\n     * Error code 801 - Call unsupported api.\n     *\n     * @syscap SystemCapability.MiscServices.Download\n     * @since 9\n     */\n    /**\n     * Error code 801 - Call unsupported api.\n     *\n     * @syscap SystemCapability.MiscServices.Download\n     * @crossplatform\n     * @since 10\n     */\n    const EXCEPTION_UNSUPPORTED: number;\n    /**\n     * Error code 13400001 - Invalid file or file system error.\n     *\n     * @syscap SystemCapability.MiscServices.Download\n     * @since 9\n     */\n    /**\n     * Error code 13400001 - Invalid file or file system error.\n     *\n     * @syscap SystemCapability.MiscServices.Download\n     * @crossplatform\n     * @since 10\n     */\n    const EXCEPTION_FILEIO: number;\n    /**\n     * Error code 13400002 - File path not supported or invalid.\n     *\n     * @syscap SystemCapability.MiscServices.Download\n     * @since 9\n     */\n    /**\n     * Error code 13400002 - File path not supported or invalid.\n     *\n     * @syscap SystemCapability.MiscServices.Download\n     * @crossplatform\n     * @since 10\n     */\n    const EXCEPTION_FILEPATH: number;\n    /**\n     * Error code 13400003 - Task service ability error.\n     *\n     * @syscap SystemCapability.MiscServices.Download\n     * @since 9\n     */\n    /**\n     * Error code 13400003 - Task service ability error.\n     *\n     * @syscap SystemCapability.MiscServices.Download\n     * @crossplatform\n     * @since 10\n     */\n    const EXCEPTION_SERVICE: number;\n    /**\n     * Error code 13499999 - Others error.\n     *\n     * @syscap SystemCapability.MiscServices.Download\n     * @since 9\n     */\n    /**\n     * Error code 13499999 - Others error.\n     *\n     * @syscap SystemCapability.MiscServices.Download\n     * @crossplatform\n     * @since 10\n     */\n    const EXCEPTION_OTHERS: number;\n    /**\n     * Code 0x00000001 - Bit flag indicating download is allowed when using the cellular network.\n     *\n     * @syscap SystemCapability.MiscServices.Download\n     * @since 6\n     */\n    /**\n     * Code 0x00000001 - Bit flag indicating download is allowed when using the cellular network.\n     *\n     * @syscap SystemCapability.MiscServices.Download\n     * @crossplatform\n     * @since 10\n     */\n    const NETWORK_MOBILE: number;\n    /**\n     * Code 0x00010000 - Bit flag indicating download is allowed when using the WLAN.\n     *\n     * @syscap SystemCapability.MiscServices.Download\n     * @since 6\n     */\n    /**\n     * Code 0x00010000 - Bit flag indicating download is allowed when using the WLAN.\n     *\n     * @syscap SystemCapability.MiscServices.Download\n     * @crossplatform\n     * @since 10\n     */\n    const NETWORK_WIFI: number;\n    /**\n     * Error code 0 - Indicates that the download cannot be resumed for network reasons.\n     *\n     * @syscap SystemCapability.MiscServices.Download\n     * @since 7\n     */\n    /**\n     * Error code 0 - Indicates that the download cannot be resumed for network reasons.\n     *\n     * @syscap SystemCapability.MiscServices.Download\n     * @crossplatform\n     * @since 10\n     */\n    const ERROR_CANNOT_RESUME: number;\n    /**\n     * Error code 1 - Indicates that no storage device, such as an SD card, is found.\n     *\n     * @syscap SystemCapability.MiscServices.Download\n     * @since 7\n     */\n    /**\n     * Error code 1 - Indicates that no storage device, such as an SD card, is found.\n     *\n     * @syscap SystemCapability.MiscServices.Download\n     * @crossplatform\n     * @since 10\n     */\n    const ERROR_DEVICE_NOT_FOUND: number;\n    /**\n     * Error code 2 - Indicates that files to be downloaded already exist, and that the download session cannot overwrite the existing files.\n     *\n     * @syscap SystemCapability.MiscServices.Download\n     * @since 7\n     */\n    /**\n     * Error code 2 - Indicates that files to be downloaded already exist, and that the download session cannot overwrite the existing files.\n     *\n     * @syscap SystemCapability.MiscServices.Download\n     * @crossplatform\n     * @since 10\n     */\n    const ERROR_FILE_ALREADY_EXISTS: number;\n    /**\n     * Error code 3 - Indicates that a file operation fails.\n     *\n     * @syscap SystemCapability.MiscServices.Download\n     * @since 7\n     */\n    /**\n     * Error code 3 - Indicates that a file operation fails.\n     *\n     * @syscap SystemCapability.MiscServices.Download\n     * @crossplatform\n     * @since 10\n     */\n    const ERROR_FILE_ERROR: number;\n    /**\n     * Error code 4 - Indicates that the HTTP transmission fails.\n     *\n     * @syscap SystemCapability.MiscServices.Download\n     * @since 7\n     */\n    /**\n     * Error code 4 - Indicates that the HTTP transmission fails.\n     *\n     * @syscap SystemCapability.MiscServices.Download\n     * @crossplatform\n     * @since 10\n     */\n    const ERROR_HTTP_DATA_ERROR: number;\n    /**\n     * Error code 5 - Indicates insufficient storage space.\n     *\n     * @syscap SystemCapability.MiscServices.Download\n     * @since 7\n     */\n    /**\n     * Error code 5 - Indicates insufficient storage space.\n     *\n     * @syscap SystemCapability.MiscServices.Download\n     * @crossplatform\n     * @since 10\n     */\n    const ERROR_INSUFFICIENT_SPACE: number;\n    /**\n     * Error code 6 - Indicates an error caused by too many network redirections.\n     *\n     * @syscap SystemCapability.MiscServices.Download\n     * @since 7\n     */\n    /**\n     * Error code 6 - Indicates an error caused by too many network redirections.\n     *\n     * @syscap SystemCapability.MiscServices.Download\n     * @crossplatform\n     * @since 10\n     */\n    const ERROR_TOO_MANY_REDIRECTS: number;\n    /**\n     * Error code 7 - Indicates an HTTP code that cannot be identified.\n     *\n     * @syscap SystemCapability.MiscServices.Download\n     * @since 7\n     */\n    /**\n     * Error code 7 - Indicates an HTTP code that cannot be identified.\n     *\n     * @syscap SystemCapability.MiscServices.Download\n     * @crossplatform\n     * @since 10\n     */\n    const ERROR_UNHANDLED_HTTP_CODE: number;\n    /**\n     * Error code 8 - Indicates an undefined error.\n     *\n     * @syscap SystemCapability.MiscServices.Download\n     * @since 7\n     */\n    /**\n     * Error code 8 - Indicates an undefined error.\n     *\n     * @syscap SystemCapability.MiscServices.Download\n     * @crossplatform\n     * @since 10\n     */\n    const ERROR_UNKNOWN: number;\n    /**\n     * Error code 9 - Indicates network offline.\n     *\n     * @syscap SystemCapability.MiscServices.Download\n     * @since 9\n     */\n    /**\n     * Error code 9 - Indicates network offline.\n     *\n     * @syscap SystemCapability.MiscServices.Download\n     * @crossplatform\n     * @since 10\n     */\n    const ERROR_OFFLINE: number;\n    /**\n     * Error code 10 - Indicates network type configuration error.\n     *\n     * @syscap SystemCapability.MiscServices.Download\n     * @since 9\n     */\n    /**\n     * Error code 10 - Indicates network type configuration error.\n     *\n     * @syscap SystemCapability.MiscServices.Download\n     * @crossplatform\n     * @since 10\n     */\n    const ERROR_UNSUPPORTED_NETWORK_TYPE: number;\n    /**\n     * Paused code 0 - Indicates that the download is paused and waiting for a WLAN connection,\n     * because the file size exceeds the maximum allowed for a session using the cellular network.\n     *\n     * @syscap SystemCapability.MiscServices.Download\n     * @since 7\n     */\n    /**\n     * Paused code 0 - Indicates that the download is paused and waiting for a WLAN connection,\n     * because the file size exceeds the maximum allowed for a session using the cellular network.\n     *\n     * @syscap SystemCapability.MiscServices.Download\n     * @crossplatform\n     * @since 10\n     */\n    const PAUSED_QUEUED_FOR_WIFI: number;\n    /**\n     * Paused code 1 - Indicates that the download is paused due to a network problem, for example, network disconnection.\n     *\n     * @syscap SystemCapability.MiscServices.Download\n     * @since 7\n     */\n    /**\n     * Paused code 1 - Indicates that the download is paused due to a network problem, for example, network disconnection.\n     *\n     * @syscap SystemCapability.MiscServices.Download\n     * @crossplatform\n     * @since 10\n     */\n    const PAUSED_WAITING_FOR_NETWORK: number;\n    /**\n     * Paused code 2 - Indicates that a network error occurs, and the download session will be retried.\n     *\n     * @syscap SystemCapability.MiscServices.Download\n     * @since 7\n     */\n    /**\n     * Paused code 2 - Indicates that a network error occurs, and the download session will be retried.\n     *\n     * @syscap SystemCapability.MiscServices.Download\n     * @crossplatform\n     * @since 10\n     */\n    const PAUSED_WAITING_TO_RETRY: number;\n    /**\n     * Paused code 3 - Indicates that the download is paused due to the user.\n     *\n     * @syscap SystemCapability.MiscServices.Download\n     * @since 9\n     */\n    /**\n     * Paused code 3 - Indicates that the download is paused due to the user.\n     *\n     * @syscap SystemCapability.MiscServices.Download\n     * @crossplatform\n     * @since 10\n     */\n    const PAUSED_BY_USER: number;\n    /**\n     * Paused code 4 - Indicates that the download is paused for some reasons.\n     *\n     * @syscap SystemCapability.MiscServices.Download\n     * @since 7\n     */\n    /**\n     * Paused code 4 - Indicates that the download is paused for some reasons.\n     *\n     * @syscap SystemCapability.MiscServices.Download\n     * @crossplatform\n     * @since 10\n     */\n    const PAUSED_UNKNOWN: number;\n    /**\n     * Session status code 0 - Indicates that the download session is completed.\n     *\n     * @syscap SystemCapability.MiscServices.Download\n     * @since 7\n     */\n    /**\n     * Session status code 0 - Indicates that the download session is completed.\n     *\n     * @syscap SystemCapability.MiscServices.Download\n     * @crossplatform\n     * @since 10\n     */\n    const SESSION_SUCCESSFUL: number;\n    /**\n     * Session status code 1 - Indicates that the download session is in progress.\n     *\n     * @syscap SystemCapability.MiscServices.Download\n     * @since 7\n     */\n    /**\n     * Session status code 1 - Indicates that the download session is in progress.\n     *\n     * @syscap SystemCapability.MiscServices.Download\n     * @crossplatform\n     * @since 10\n     */\n    const SESSION_RUNNING: number;\n    /**\n     * Session status code 2 - Indicates that the download session is being scheduled.\n     *\n     * @syscap SystemCapability.MiscServices.Download\n     * @since 7\n     */\n    /**\n     * Session status code 2 - Indicates that the download session is being scheduled.\n     *\n     * @syscap SystemCapability.MiscServices.Download\n     * @crossplatform\n     * @since 10\n     */\n    const SESSION_PENDING: number;\n    /**\n     * Session status code 3 - Indicates that the download session has been paused.\n     *\n     * @syscap SystemCapability.MiscServices.Download\n     * @since 7\n     */\n    /**\n     * Session status code 3 - Indicates that the download session has been paused.\n     *\n     * @syscap SystemCapability.MiscServices.Download\n     * @crossplatform\n     * @since 10\n     */\n    const SESSION_PAUSED: number;\n    /**\n     * Session status code 4 - Indicates that the download session has failed and will not be retried.\n     *\n     * @syscap SystemCapability.MiscServices.Download\n     * @since 7\n     */\n    /**\n     * Session status code 4 - Indicates that the download session has failed and will not be retried.\n     *\n     * @syscap SystemCapability.MiscServices.Download\n     * @crossplatform\n     * @since 10\n     */\n    const SESSION_FAILED: number;\n    /**\n     * Starts a download task.\n     *\n     * @permission ohos.permission.INTERNET\n     * @param { DownloadConfig } config Download config\n     * @param { AsyncCallback<DownloadTask> } callback Indicate the callback function to receive DownloadTask.\n     * @throws { BusinessError } 201 - The permissions check fails.\n     * @syscap SystemCapability.MiscServices.Download\n     * @FAModelOnly\n     * @since 6\n     * @deprecated since 9\n     * @useinstead ohos.request.downloadFile\n     */\n    function download(config: DownloadConfig, callback: AsyncCallback<DownloadTask>): void;\n    /**\n     * Starts a download task.\n     *\n     * @permission ohos.permission.INTERNET\n     * @param { BaseContext } context Indicates the application BaseContext.\n     * @param { DownloadConfig } config Download config\n     * @param { AsyncCallback<DownloadTask> } callback Indicate the callback function to receive DownloadTask.\n     * @throws { BusinessError } 201 - The permissions check fails.\n     * @throws { BusinessError } 401 - The parameters check fails. Possible causes: 1. Missing mandatory parameters.\n     * <br>2. Incorrect parameter type. 3. Parameter verification failed.\n     * @throws { BusinessError } 13400001 - Invalid file or file system error.\n     * @throws { BusinessError } 13400002 - File path not supported or invalid.\n     * @throws { BusinessError } 13400003 - task service ability error\n     * @syscap SystemCapability.MiscServices.Download\n     * @since 9\n     */\n    /**\n     * Starts a download task.\n     *\n     * @permission ohos.permission.INTERNET\n     * @param { BaseContext } context Indicates the application BaseContext.\n     * @param { DownloadConfig } config Download config\n     * @param { AsyncCallback<DownloadTask> } callback Indicate the callback function to receive DownloadTask.\n     * @throws { BusinessError } 201 - The permissions check fails.\n     * @throws { BusinessError } 401 - The parameters check fails. Possible causes: 1. Missing mandatory parameters.\n     * <br>2. Incorrect parameter type. 3. Parameter verification failed.\n     * @throws { BusinessError } 13400001 - Invalid file or file system error.\n     * @throws { BusinessError } 13400002 - File path not supported or invalid.\n     * @throws { BusinessError } 13400003 - Task service ability error.\n     * @syscap SystemCapability.MiscServices.Download\n     * @crossplatform\n     * @since 10\n     */\n    function downloadFile(context: BaseContext, config: DownloadConfig, callback: AsyncCallback<DownloadTask>): void;\n    /**\n     * Starts a download task.\n     *\n     * @permission ohos.permission.INTERNET\n     * @param { DownloadConfig } config Download config\n     * @returns { Promise<DownloadTask> } the promise returned by the function.\n     * @throws { BusinessError } 201 - The permissions check fails.\n     * @syscap SystemCapability.MiscServices.Download\n     * @FAModelOnly\n     * @since 6\n     * @deprecated since 9\n     * @useinstead ohos.request.downloadFile\n     */\n    function download(config: DownloadConfig): Promise<DownloadTask>;\n    /**\n     * Starts a download task.\n     *\n     * @permission ohos.permission.INTERNET\n     * @param { BaseContext } context Indicates the application BaseContext.\n     * @param { DownloadConfig } config Download config\n     * @returns { Promise<DownloadTask> } the promise returned by the function.\n     * @throws { BusinessError } 201 - The permissions check fails.\n     * @throws { BusinessError } 401 - The parameters check fails. Possible causes: 1. Missing mandatory parameters.\n     * <br>2. Incorrect parameter type. 3. Parameter verification failed.\n     * @throws { BusinessError } 13400001 - Invalid file or file system error.\n     * @throws { BusinessError } 13400002 - File path not supported or invalid.\n     * @throws { BusinessError } 13400003 - task service ability error\n     * @syscap SystemCapability.MiscServices.Download\n     * @since 9\n     */\n    /**\n     * Starts a download task.\n     *\n     * @permission ohos.permission.INTERNET\n     * @param { BaseContext } context Indicates the application BaseContext.\n     * @param { DownloadConfig } config Download config\n     * @returns { Promise<DownloadTask> } the promise returned by the function.\n     * @throws { BusinessError } 201 - The permissions check fails.\n     * @throws { BusinessError } 401 - The parameters check fails. Possible causes: 1. Missing mandatory parameters.\n     * <br>2. Incorrect parameter type. 3. Parameter verification failed.\n     * @throws { BusinessError } 13400001 - Invalid file or file system error.\n     * @throws { BusinessError } 13400002 - File path not supported or invalid.\n     * @throws { BusinessError } 13400003 - Task service ability error.\n     * @syscap SystemCapability.MiscServices.Download\n     * @crossplatform\n     * @since 10\n     */\n    function downloadFile(context: BaseContext, config: DownloadConfig): Promise<DownloadTask>;\n    /**\n     * Starts an upload task.\n     *\n     * @permission ohos.permission.INTERNET\n     * @param { UploadConfig } config Upload config\n     * @param { AsyncCallback<UploadTask> } callback Indicate the callback function to receive UploadTask.\n     * @throws { BusinessError } 201 - The permissions check fails.\n     * @syscap SystemCapability.MiscServices.Upload\n     * @FAModelOnly\n     * @since 6\n     * @deprecated since 9\n     * @useinstead ohos.request.uploadFile\n     */\n    function upload(config: UploadConfig, callback: AsyncCallback<UploadTask>): void;\n    /**\n     * Starts an upload task.\n     *\n     * @permission ohos.permission.INTERNET\n     * @param { BaseContext } context Indicates the application BaseContext.\n     * @param { UploadConfig } config Upload config\n     * @param { AsyncCallback<UploadTask> } callback Indicate the callback function to receive UploadTask.\n     * @throws { BusinessError } 201 - The permissions check fails.\n     * @throws { BusinessError } 401 - The parameters check fails. Possible causes: 1. Missing mandatory parameters.\n     * <br>2. Incorrect parameter type. 3. Parameter verification failed.\n     * @throws { BusinessError } 13400002 - File path not supported or invalid.\n     * @syscap SystemCapability.MiscServices.Upload\n     * @since 9\n     */\n    /**\n     * Starts an upload task.\n     *\n     * @permission ohos.permission.INTERNET\n     * @param { BaseContext } context Indicates the application BaseContext.\n     * @param { UploadConfig } config Upload config\n     * @param { AsyncCallback<UploadTask> } callback Indicate the callback function to receive UploadTask.\n     * @throws { BusinessError } 201 - The permissions check fails.\n     * @throws { BusinessError } 401 - The parameters check fails. Possible causes: 1. Missing mandatory parameters.\n     * <br>2. Incorrect parameter type. 3. Parameter verification failed.\n     * @throws { BusinessError } 13400002 - File path not supported or invalid.\n     * @syscap SystemCapability.MiscServices.Upload\n     * @crossplatform\n     * @since 10\n     */\n    function uploadFile(context: BaseContext, config: UploadConfig, callback: AsyncCallback<UploadTask>): void;\n    /**\n     * Starts an upload task.\n     *\n     * @permission ohos.permission.INTERNET\n     * @param { UploadConfig } config Upload config\n     * @returns { Promise<UploadTask> } the promise returned by the function.\n     * @throws { BusinessError } 201 - The permissions check fails.\n     * @syscap SystemCapability.MiscServices.Upload\n     * @FAModelOnly\n     * @since 6\n     * @deprecated since 9\n     * @useinstead ohos.request.uploadFile\n     */\n    function upload(config: UploadConfig): Promise<UploadTask>;\n    /**\n     * Starts an upload task.\n     *\n     * @permission ohos.permission.INTERNET\n     * @param { BaseContext } context Indicates the application BaseContext.\n     * @param { UploadConfig } config Upload config\n     * @returns { Promise<UploadTask> } the promise returned by the function.\n     * @throws { BusinessError } 201 - The permissions check fails.\n     * @throws { BusinessError } 401 - The parameters check fails. Possible causes: 1. Missing mandatory parameters.\n     * <br>2. Incorrect parameter type. 3. Parameter verification failed.\n     * @throws { BusinessError } 13400002 - File path not supported or invalid.\n     * @syscap SystemCapability.MiscServices.Upload\n     * @since 9\n     */\n    /**\n     * Starts an upload task.\n     *\n     * @permission ohos.permission.INTERNET\n     * @param { BaseContext } context Indicates the application BaseContext.\n     * @param { UploadConfig } config Upload config\n     * @returns { Promise<UploadTask> } the promise returned by the function.\n     * @throws { BusinessError } 201 - The permissions check fails.\n     * @throws { BusinessError } 401 - The parameters check fails. Possible causes: 1. Missing mandatory parameters.\n     * <br>2. Incorrect parameter type. 3. Parameter verification failed.\n     * @throws { BusinessError } 13400002 - File path not supported or invalid.\n     * @syscap SystemCapability.MiscServices.Upload\n     * @crossplatform\n     * @since 10\n     */\n    function uploadFile(context: BaseContext, config: UploadConfig): Promise<UploadTask>;\n    /**\n     * DownloadConfig data structure.\n     * Defines the download task configuration.\n     *\n     * @interface DownloadConfig\n     * @syscap SystemCapability.MiscServices.Download\n     * @since 6\n     * @name DownloadConfig\n     */\n    /**\n     * DownloadConfig data structure.\n     * Defines the download task configuration.\n     *\n     * @typedef DownloadConfig\n     * @syscap SystemCapability.MiscServices.Download\n     * @crossplatform\n     * @since 10\n     * @name DownloadConfig\n     */\n    interface DownloadConfig {\n        /**\n         * Resource address.\n         * Verification rule: Starting with http (s)://and with a length not exceeding 2048 characters.\n         *\n         * @syscap SystemCapability.MiscServices.Download\n         * @since 6\n         */\n        /**\n         * Resource address.\n         * Verification rule: Starting with http (s)://and with a length not exceeding 2048 characters.\n         *\n         * @type { string }\n         * @syscap SystemCapability.MiscServices.Download\n         * @crossplatform\n         * @since 10\n         */\n        /**\n         * Resource address.\n         * Verification rule: Starting with http (s)://and with a length not exceeding 8192 characters.\n         *\n         * @type { string }\n         * @syscap SystemCapability.MiscServices.Download\n         * @crossplatform\n         * @since 15\n         */\n        url: string;\n        /**\n         * Adds an HTTP or HTTPS header to be included with the download request.\n         *\n         * @syscap SystemCapability.MiscServices.Download\n         * @since 6\n         */\n        /**\n         * Adds an HTTP or HTTPS header to be included with the download request.\n         *\n         * @type { ?Object }\n         * @syscap SystemCapability.MiscServices.Download\n         * @crossplatform\n         * @since 10\n         */\n        header?: Object;\n        /**\n         * Allows download under a metered connection.\n         *\n         * @syscap SystemCapability.MiscServices.Download\n         * @since 6\n         */\n        /**\n         * Allows download under a metered connection.\n         *\n         * @type { ?boolean }\n         * @syscap SystemCapability.MiscServices.Download\n         * @crossplatform\n         * @since 10\n         */\n        enableMetered?: boolean;\n        /**\n         * Allows download in a roaming network.\n         *\n         * @syscap SystemCapability.MiscServices.Download\n         * @since 6\n         */\n        /**\n         * Allows download in a roaming network.\n         *\n         * @type { ?boolean }\n         * @syscap SystemCapability.MiscServices.Download\n         * @crossplatform\n         * @since 10\n         */\n        enableRoaming?: boolean;\n        /**\n         * Sets the description of a download session.\n         *\n         * @syscap SystemCapability.MiscServices.Download\n         * @since 6\n         */\n        /**\n         * Sets the description of a download session.\n         *\n         * @type { ?string }\n         * @syscap SystemCapability.MiscServices.Download\n         * @crossplatform\n         * @since 10\n         */\n        description?: string;\n        /**\n         * Sets the network type allowed for download.\n         *\n         * @syscap SystemCapability.MiscServices.Download\n         * @since 6\n         */\n        /**\n         * Sets the network type allowed for download.\n         *\n         * @type { ?number }\n         * @syscap SystemCapability.MiscServices.Download\n         * @crossplatform\n         * @since 10\n         */\n        networkType?: number;\n        /**\n         * Sets the path where the downloaded file is stored.\n         *\n         * @syscap SystemCapability.MiscServices.Download\n         * @since 7\n         */\n        /**\n         * Sets the path where the downloaded file is stored.\n         *\n         * @type { ?string }\n         * @syscap SystemCapability.MiscServices.Download\n         * @crossplatform\n         * @since 10\n         */\n        filePath?: string;\n        /**\n         * Sets a download session title.\n         *\n         * @syscap SystemCapability.MiscServices.Download\n         * @since 6\n         */\n        /**\n         * Sets a download session title.\n         *\n         * @type { ?string }\n         * @syscap SystemCapability.MiscServices.Download\n         * @crossplatform\n         * @since 10\n         */\n        title?: string;\n        /**\n         * Allow download background task notifications.\n         *\n         * @syscap SystemCapability.MiscServices.Download\n         * @since 9\n         */\n        /**\n         * Allow download background task notifications.\n         *\n         * @type { ?boolean }\n         * @syscap SystemCapability.MiscServices.Download\n         * @crossplatform\n         * @since 10\n         */\n        background?: boolean;\n    }\n    /**\n     * DownloadInfo data structure.\n     * Defines the download task information.\n     *\n     * @interface DownloadInfo\n     * @syscap SystemCapability.MiscServices.Download\n     * @since 7\n     * @name DownloadInfo\n     */\n    /**\n     * DownloadInfo data structure.\n     * Defines the download task information.\n     *\n     * @typedef DownloadInfo\n     * @syscap SystemCapability.MiscServices.Download\n     * @crossplatform\n     * @since 10\n     */\n    interface DownloadInfo {\n        /**\n         * The description of a file to be downloaded.\n         *\n         * @syscap SystemCapability.MiscServices.Download\n         * @since 7\n         */\n        /**\n         * The description of a file to be downloaded.\n         *\n         * @type { string }\n         * @syscap SystemCapability.MiscServices.Download\n         * @crossplatform\n         * @since 10\n         */\n        description: string;\n        /**\n         * The real-time downloads size (in bytes).\n         *\n         * @syscap SystemCapability.MiscServices.Download\n         * @since 7\n         */\n        /**\n         * The real-time downloads size (in bytes).\n         *\n         * @type { number }\n         * @syscap SystemCapability.MiscServices.Download\n         * @crossplatform\n         * @since 10\n         */\n        downloadedBytes: number;\n        /**\n         * The ID of a file to be downloaded.\n         *\n         * @syscap SystemCapability.MiscServices.Download\n         * @since 7\n         */\n        /**\n         * The ID of a file to be downloaded.\n         *\n         * @type { number }\n         * @syscap SystemCapability.MiscServices.Download\n         * @crossplatform\n         * @since 10\n         */\n        downloadId: number;\n        /**\n         * Cause of the download failure, which can be any DownloadSession.ERROR_* constant.\n         *\n         * @syscap SystemCapability.MiscServices.Download\n         * @since 7\n         */\n        /**\n         * Cause of the download failure, which can be any DownloadSession.ERROR_* constant.\n         *\n         * @type { number }\n         * @syscap SystemCapability.MiscServices.Download\n         * @crossplatform\n         * @since 10\n         */\n        failedReason: number;\n        /**\n         * The name of a file to be downloaded.\n         *\n         * @syscap SystemCapability.MiscServices.Download\n         * @since 7\n         */\n        /**\n         * The name of a file to be downloaded.\n         *\n         * @type { string }\n         * @syscap SystemCapability.MiscServices.Download\n         * @crossplatform\n         * @since 10\n         */\n        fileName: string;\n        /**\n         * The URI of a stored file.\n         *\n         * @syscap SystemCapability.MiscServices.Download\n         * @since 7\n         */\n        /**\n         * The URI of a stored file.\n         *\n         * @type { string }\n         * @syscap SystemCapability.MiscServices.Download\n         * @crossplatform\n         * @since 10\n         */\n        filePath: string;\n        /**\n         * Cause of download pause which can be any DownloadSession.PAUSED_* constant.\n         *\n         * @syscap SystemCapability.MiscServices.Download\n         * @since 7\n         */\n        /**\n         * Cause of download pause, which can be any DownloadSession.PAUSED_* constant.\n         *\n         * @type { number }\n         * @syscap SystemCapability.MiscServices.Download\n         * @crossplatform\n         * @since 10\n         */\n        pausedReason: number;\n        /**\n         * The download task status code, which can be any DownloadSession.SESSION_* constant.\n         *\n         * @syscap SystemCapability.MiscServices.Download\n         * @since 7\n         */\n        /**\n         * The download task status code, which can be any DownloadSession.SESSION_* constant.\n         *\n         * @type { number }\n         * @syscap SystemCapability.MiscServices.Download\n         * @crossplatform\n         * @since 10\n         */\n        status: number;\n        /**\n         * The URI of files to be downloaded.\n         *\n         * @syscap SystemCapability.MiscServices.Download\n         * @since 7\n         */\n        /**\n         * The URI of files to be downloaded.\n         *\n         * @type { string }\n         * @syscap SystemCapability.MiscServices.Download\n         * @crossplatform\n         * @since 10\n         */\n        targetURI: string;\n        /**\n         * The title of a file to be downloaded.\n         *\n         * @syscap SystemCapability.MiscServices.Download\n         * @since 7\n         */\n        /**\n         * The title of a file to be downloaded.\n         *\n         * @type { string }\n         * @syscap SystemCapability.MiscServices.Download\n         * @crossplatform\n         * @since 10\n         */\n        downloadTitle: string;\n        /**\n         * The total size of files to be downloaded (in bytes).\n         *\n         * @syscap SystemCapability.MiscServices.Download\n         * @since 7\n         */\n        /**\n         * The total size of files to be downloaded (in bytes).\n         *\n         * @type { number }\n         * @syscap SystemCapability.MiscServices.Download\n         * @crossplatform\n         * @since 10\n         */\n        downloadTotalBytes: number;\n    }\n    /**\n     * Download task interface.\n     * Implements file downloads.\n     *\n     * @interface DownloadTask\n     * @syscap SystemCapability.MiscServices.Download\n     * @since 6\n     */\n    /**\n     * Download task interface.\n     * Implements file downloads.\n     *\n     * @typedef DownloadTask\n     * @syscap SystemCapability.MiscServices.Download\n     * @crossplatform\n     * @since 10\n     */\n    interface DownloadTask {\n        /**\n         * Called when the current download session is in process.\n         * Subscribes to download progress events.\n         *\n         * @param { 'progress' } type progress Indicates the download task progress.\n         * @param { function } callback\n         *        The callback function for the download progress change event\n         *        receivedSize the length of downloaded data, in bytes\n         *        totalSize the length of data expected to be downloaded, in bytes.\n         * @syscap SystemCapability.MiscServices.Download\n         * @since 6\n         */\n        /**\n         * Called when the current download session is in process.\n         * Subscribes to download progress events.\n         *\n         * @param { 'progress' } type progress Indicates the download task progress.\n         * @param { function } callback\n         *        The callback function for the download progress change event\n         *        receivedSize the length of downloaded data, in bytes\n         *        totalSize the length of data expected to be downloaded, in bytes.\n         * @syscap SystemCapability.MiscServices.Download\n         * @crossplatform\n         * @since 10\n         */\n        /**\n         * Called when the current download session is in process.\n         * Subscribes to download progress events.\n         *\n         * @param { 'progress' } type progress Indicates the download task progress.\n         * @param { function } callback\n         * <br>The callback function for the download progress change event\n         * <br>receivedSize the length of downloaded data, in bytes\n         * <br>totalSize the length of data expected to be downloaded, in bytes.\n         * @throws { BusinessError } 401 - The parameters check fails. Possible causes: 1. Missing mandatory parameters.\n         * <br>2. Incorrect parameter type. 3. Parameter verification failed.\n         * @syscap SystemCapability.MiscServices.Download\n         * @crossplatform\n         * @since 12\n         */\n        on(type: 'progress', callback: (receivedSize: number, totalSize: number) => void): void;\n        /**\n         * Called when the current download session is in process.\n         * Unsubscribes from download progress events.\n         *\n         * @param { 'progress' } type progress Indicates the download task progress.\n         * @param { function } [callback]\n         *        The callback function for the download progress change event\n         *        receivedSize the length of downloaded data, in bytes\n         *        totalSize the length of data expected to be downloaded, in bytes.\n         * @syscap SystemCapability.MiscServices.Download\n         * @since 6\n         */\n        /**\n         * Called when the current download session is in process.\n         * Unsubscribes from download progress events.\n         *\n         * @param { 'progress' } type progress Indicates the download task progress.\n         * @param { function } [callback]\n         *        The callback function for the download progress change event\n         *        receivedSize the length of downloaded data, in bytes\n         *        totalSize the length of data expected to be downloaded, in bytes.\n         * @syscap SystemCapability.MiscServices.Download\n         * @crossplatform\n         * @since 10\n         */\n        /**\n         * Called when the current download session is in process.\n         * Unsubscribes from download progress events.\n         *\n         * @param { 'progress' } type progress Indicates the download task progress.\n         * @param { function } [callback]\n         * <br>The callback function for the download progress change event\n         * <br>receivedSize the length of downloaded data, in bytes\n         * <br>totalSize the length of data expected to be downloaded, in bytes.\n         * @throws { BusinessError } 401 - The parameters check fails. Possible causes: 1. Missing mandatory parameters.\n         * <br>2. Incorrect parameter type. 3. Parameter verification failed.\n         * @syscap SystemCapability.MiscServices.Download\n         * @crossplatform\n         * @since 12\n         */\n        off(type: 'progress', callback?: (receivedSize: number, totalSize: number) => void): void;\n        /**\n         * Called when the current download session complete pause or remove.\n         * Subscribes to download events.\n         *\n         * @param { 'complete' | 'pause' | 'remove' } type Indicates the download session event type\n         *        complete: download task completed,\n         *        pause: download task stopped,\n         *        remove: download task deleted.\n         * @param { function } callback The callback function for the download complete pause or remove change event.\n         * @syscap SystemCapability.MiscServices.Download\n         * @since 7\n         */\n        /**\n         * Called when the current download session complete pause or remove.\n         * Subscribes to download events.\n         *\n         * @param { 'complete' | 'pause' | 'remove' } type Indicates the download session event type\n         *        complete: download task completed,\n         *        pause: download task stopped,\n         *        remove: download task deleted.\n         * @param { function } callback The callback function for the download complete pause or remove change event.\n         * @syscap SystemCapability.MiscServices.Download\n         * @crossplatform\n         * @since 10\n         */\n        /**\n         * Called when the current download session complete pause or remove.\n         * Subscribes to download events.\n         *\n         * @param { 'complete' | 'pause' | 'remove' } type Indicates the download session event type\n         * <br>complete: download task completed,\n         * <br>pause: download task stopped,\n         * <br>remove: download task deleted.\n         * @param { function } callback The callback function for the download complete pause or remove change event.\n         * @throws { BusinessError } 401 - The parameters check fails. Possible causes: 1. Missing mandatory parameters.\n         * <br>2. Incorrect parameter type. 3. Parameter verification failed.\n         * @syscap SystemCapability.MiscServices.Download\n         * @crossplatform\n         * @since 12\n         */\n        on(type: 'complete' | 'pause' | 'remove', callback: () => void): void;\n        /**\n         * Called when the current download session complete pause or remove.\n         * Unsubscribes from download events.\n         *\n         * @param { 'complete' | 'pause' | 'remove' } type Indicates the download session event type\n         *        complete: download task completed,\n         *        pause: download task stopped,\n         *        remove: download task deleted.\n         * @param { function } [callback] The callback function for the download complete pause or remove change event.\n         * @syscap SystemCapability.MiscServices.Download\n         * @since 7\n         */\n        /**\n         * Called when the current download session complete pause or remove.\n         * Unsubscribes from download events.\n         *\n         * @param { 'complete' | 'pause' | 'remove' } type Indicates the download session event type\n         *        complete: download task completed,\n         *        pause: download task stopped,\n         *        remove: download task deleted.\n         * @param { function } [callback] The callback function for the download complete pause or remove change event.\n         * @syscap SystemCapability.MiscServices.Download\n         * @crossplatform\n         * @since 10\n         */\n        /**\n         * Called when the current download session complete pause or remove.\n         * Unsubscribes from download events.\n         *\n         * @param { 'complete' | 'pause' | 'remove' } type Indicates the download session event type\n         * <br>complete: download task completed,\n         * <br>pause: download task stopped,\n         * <br>remove: download task deleted.\n         * @param { function } [callback] The callback function for the download complete pause or remove change event.\n         * @throws { BusinessError } 401 - The parameters check fails. Possible causes: 1. Missing mandatory parameters.\n         * <br>2. Incorrect parameter type. 3. Parameter verification failed.\n         * @syscap SystemCapability.MiscServices.Download\n         * @crossplatform\n         * @since 12\n         */\n        off(type: 'complete' | 'pause' | 'remove', callback?: () => void): void;\n        /**\n         * Called when the current download session fails.\n         * Subscribes to download failure events.\n         *\n         * @param { 'fail' } type Indicates the download session type, fail: download task has failed.\n         * @param { function } callback The callback function for the download fail change event\n         *        err The error code for download task.\n         * @syscap SystemCapability.MiscServices.Download\n         * @since 7\n         */\n        /**\n         * Called when the current download session fails.\n         * Subscribes to download failure events.\n         *\n         * @param { 'fail' } type Indicates the download session type, fail: download task has failed.\n         * @param { function } callback The callback function for the download fail change event\n         *        err The error code for download task.\n         * @syscap SystemCapability.MiscServices.Download\n         * @crossplatform\n         * @since 10\n         */\n        /**\n         * Called when the current download session fails.\n         * Subscribes to download failure events.\n         *\n         * @param { 'fail' } type Indicates the download session type, fail: download task has failed.\n         * @param { function } callback The callback function for the download fail change event\n         * <br>err The error code for download task.\n         * @throws { BusinessError } 401 - The parameters check fails. Possible causes: 1. Missing mandatory parameters.\n         * <br>2. Incorrect parameter type. 3. Parameter verification failed.\n         * @syscap SystemCapability.MiscServices.Download\n         * @crossplatform\n         * @since 12\n         */\n        on(type: 'fail', callback: (err: number) => void): void;\n        /**\n         * Called when the current download session fails.\n         * Unsubscribes from download failure events.\n         *\n         * @param { 'fail' } type Indicates the download session type, fail: download task has failed.\n         * @param { function } [callback] Indicate the callback function to receive err.\n         *        err The error code for download task.\n         * @syscap SystemCapability.MiscServices.Download\n         * @since 7\n         */\n        /**\n         * Called when the current download session fails.\n         * Unsubscribes from download failure events.\n         *\n         * @param { 'fail' } type Indicates the download session type, fail: download task has failed.\n         * @param { function } [callback] Indicate the callback function to receive err.\n         *        err The error code for download task.\n         * @syscap SystemCapability.MiscServices.Download\n         * @crossplatform\n         * @since 10\n         */\n        /**\n         * Called when the current download session fails.\n         * Unsubscribes from download failure events.\n         *\n         * @param { 'fail' } type Indicates the download session type, fail: download task has failed.\n         * @param { function } [callback] Indicate the callback function to receive err.\n         * <br>err The error code for download task.\n         * @throws { BusinessError } 401 - The parameters check fails. Possible causes: 1. Missing mandatory parameters.\n         * <br>2. Incorrect parameter type. 3. Parameter verification failed.\n         * @syscap SystemCapability.MiscServices.Download\n         * @crossplatform\n         * @since 12\n         */\n        off(type: 'fail', callback?: (err: number) => void): void;\n        /**\n         * Deletes a download session and the downloaded files.\n         *\n         * @permission ohos.permission.INTERNET\n         * @param { AsyncCallback<boolean> } callback Indicates asynchronous invoking Result.\n         * @throws { BusinessError } 201 - The permissions check fails.\n         * @syscap SystemCapability.MiscServices.Download\n         * @since 6\n         * @deprecated since 9\n         * @useinstead ohos.request.delete\n         */\n        remove(callback: AsyncCallback<boolean>): void;\n        /**\n         * Deletes a download session and the downloaded files.\n         *\n         * @permission ohos.permission.INTERNET\n         * @returns { Promise<boolean> } the promise returned by the function.\n         * @throws { BusinessError } 201 - The permissions check fails.\n         * @syscap SystemCapability.MiscServices.Download\n         * @since 6\n         * @deprecated since 9\n         * @useinstead ohos.request.delete\n         */\n        remove(): Promise<boolean>;\n        /**\n         * Pause a download session.\n         *\n         * @permission ohos.permission.INTERNET\n         * @param { AsyncCallback<void> } callback Indicates asynchronous invoking Result.\n         * @throws { BusinessError } 201 - The permissions check fails.\n         * @syscap SystemCapability.MiscServices.Download\n         * @since 7\n         * @deprecated since 9\n         * @useinstead ohos.request.suspend\n         */\n        pause(callback: AsyncCallback<void>): void;\n        /**\n         * Pause a download session.\n         *\n         * @permission ohos.permission.INTERNET\n         * @returns { Promise<void> } the promise returned by the function.\n         * @throws { BusinessError } 201 - The permissions check fails.\n         * @syscap SystemCapability.MiscServices.Download\n         * @since 7\n         * @deprecated since 9\n         * @useinstead ohos.request.suspend\n         */\n        pause(): Promise<void>;\n        /**\n         * Resume a paused download session.\n         *\n         * @permission ohos.permission.INTERNET\n         * @param { AsyncCallback<void> } callback Indicates asynchronous invoking Result.\n         * @throws { BusinessError } 201 - The permissions check fails.\n         * @syscap SystemCapability.MiscServices.Download\n         * @since 7\n         * @deprecated since 9\n         * @useinstead ohos.request.restore\n         */\n        resume(callback: AsyncCallback<void>): void;\n        /**\n         * Resume a paused download session.\n         *\n         * @permission ohos.permission.INTERNET\n         * @returns { Promise<void> } the promise returned by the function.\n         * @throws { BusinessError } 201 - The permissions check fails.\n         * @syscap SystemCapability.MiscServices.Download\n         * @since 7\n         * @deprecated since 9\n         * @useinstead ohos.request.restore\n         */\n        resume(): Promise<void>;\n        /**\n         * Queries download information of a session, which is defined in DownloadSession.DownloadInfo.\n         *\n         * @permission ohos.permission.INTERNET\n         * @param { AsyncCallback<DownloadInfo> } callback Indicate the callback function to receive download info.\n         * @throws { BusinessError } 201 - The permissions check fails.\n         * @syscap SystemCapability.MiscServices.Download\n         * @since 7\n         * @deprecated since 9\n         * @useinstead ohos.request.getTaskInfo\n         */\n        query(callback: AsyncCallback<DownloadInfo>): void;\n        /**\n         * Queries download information of a session, which is defined in DownloadSession.DownloadInfo.\n         *\n         * @permission ohos.permission.INTERNET\n         * @returns { Promise<DownloadInfo> } the promise returned by the function.\n         * @throws { BusinessError } 201 - The permissions check fails.\n         * @syscap SystemCapability.MiscServices.Download\n         * @since 7\n         * @deprecated since 9\n         * @useinstead ohos.request.getTaskInfo\n         */\n        query(): Promise<DownloadInfo>;\n        /**\n         * Queries the MIME type of the download file.\n         *\n         * @permission ohos.permission.INTERNET\n         * @param { AsyncCallback<string> } callback Indicate the callback function to receive download file MIME type.\n         * @throws { BusinessError } 201 - The permissions check fails.\n         * @syscap SystemCapability.MiscServices.Download\n         * @since 7\n         * @deprecated since 9\n         * @useinstead ohos.request.getTaskMimeType\n         */\n        queryMimeType(callback: AsyncCallback<string>): void;\n        /**\n         * Queries the MIME type of the download file.\n         *\n         * @permission ohos.permission.INTERNET\n         * @returns { Promise<string> } the promise returned by the function.\n         * @throws { BusinessError } 201 - The permissions check fails.\n         * @syscap SystemCapability.MiscServices.Download\n         * @since 7\n         * @deprecated since 9\n         * @useinstead ohos.request.getTaskMimeType\n         */\n        queryMimeType(): Promise<string>;\n        /**\n         * Delete the download task\n         *\n         * @permission ohos.permission.INTERNET\n         * @param { AsyncCallback<boolean> } callback\n         * @throws { BusinessError } 201 - The permissions check fails.\n         * @throws { BusinessError } 401 - The parameters check fails.\n         * @syscap SystemCapability.MiscServices.Download\n         * @since 9\n         */\n        /**\n         * Delete the download task\n         *\n         * @permission ohos.permission.INTERNET\n         * @param { AsyncCallback<boolean> } callback\n         * @throws { BusinessError } 201 - The permissions check fails.\n         * @throws { BusinessError } 401 - The parameters check fails.\n         * @syscap SystemCapability.MiscServices.Download\n         * @crossplatform\n         * @since 10\n         */\n        /**\n         * Delete the download task\n         *\n         * @permission ohos.permission.INTERNET\n         * @param { AsyncCallback<boolean> } callback\n         * @throws { BusinessError } 201 - The permissions check fails.\n         * @syscap SystemCapability.MiscServices.Download\n         * @crossplatform\n         * @since 12\n         */\n        delete(callback: AsyncCallback<boolean>): void;\n        /**\n         * Delete the download task\n         *\n         * @permission ohos.permission.INTERNET\n         * @returns { Promise<boolean> } the promise returned by the function.\n         * @throws { BusinessError } 201 - The permissions check fails.\n         * @throws { BusinessError } 401 - The parameters check fails.\n         * @syscap SystemCapability.MiscServices.Download\n         * @since 9\n         */\n        /**\n         * Delete the download task\n         *\n         * @permission ohos.permission.INTERNET\n         * @returns { Promise<boolean> } the promise returned by the function.\n         * @throws { BusinessError } 201 - The permissions check fails.\n         * @throws { BusinessError } 401 - The parameters check fails.\n         * @syscap SystemCapability.MiscServices.Download\n         * @crossplatform\n         * @since 10\n         */\n        /**\n         * Delete the download task\n         *\n         * @permission ohos.permission.INTERNET\n         * @returns { Promise<boolean> } the promise returned by the function.\n         * @throws { BusinessError } 201 - The permissions check fails.\n         * @syscap SystemCapability.MiscServices.Download\n         * @crossplatform\n         * @since 12\n         */\n        delete(): Promise<boolean>;\n        /**\n         * Suspend the download task\n         *\n         * @permission ohos.permission.INTERNET\n         * @param { AsyncCallback<boolean> } callback\n         * @throws { BusinessError } 201 - The permissions check fails.\n         * @throws { BusinessError } 401 - The parameters check fails.\n         * @syscap SystemCapability.MiscServices.Download\n         * @since 9\n         */\n        /**\n         * Suspend the download task\n         *\n         * @permission ohos.permission.INTERNET\n         * @param { AsyncCallback<boolean> } callback\n         * @throws { BusinessError } 201 - The permissions check fails.\n         * @throws { BusinessError } 401 - The parameters check fails.\n         * @syscap SystemCapability.MiscServices.Download\n         * @crossplatform\n         * @since 10\n         */\n        /**\n         * Suspend the download task\n         *\n         * @permission ohos.permission.INTERNET\n         * @param { AsyncCallback<boolean> } callback\n         * @throws { BusinessError } 201 - The permissions check fails.\n         * @syscap SystemCapability.MiscServices.Download\n         * @crossplatform\n         * @since 12\n         */\n        suspend(callback: AsyncCallback<boolean>): void;\n        /**\n         * Suspend the download task\n         *\n         * @permission ohos.permission.INTERNET\n         * @returns { Promise<boolean> } the promise returned by the function.\n         * @throws { BusinessError } 201 - The permissions check fails.\n         * @throws { BusinessError } 401 - The parameters check fails.\n         * @syscap SystemCapability.MiscServices.Download\n         * @since 9\n         */\n        /**\n         * Suspend the download task\n         *\n         * @permission ohos.permission.INTERNET\n         * @returns { Promise<boolean> } the promise returned by the function.\n         * @throws { BusinessError } 201 - The permissions check fails.\n         * @throws { BusinessError } 401 - The parameters check fails.\n         * @syscap SystemCapability.MiscServices.Download\n         * @crossplatform\n         * @since 10\n         */\n        /**\n         * Suspend the download task\n         *\n         * @permission ohos.permission.INTERNET\n         * @returns { Promise<boolean> } the promise returned by the function.\n         * @throws { BusinessError } 201 - The permissions check fails.\n         * @syscap SystemCapability.MiscServices.Download\n         * @crossplatform\n         * @since 12\n         */\n        suspend(): Promise<boolean>;\n        /**\n         * Restore the download task\n         *\n         * @permission ohos.permission.INTERNET\n         * @param { AsyncCallback<boolean> } callback\n         * @throws { BusinessError } 201 - The permissions check fails.\n         * @throws { BusinessError } 401 - The parameters check fails.\n         * @syscap SystemCapability.MiscServices.Download\n         * @since 9\n         */\n        /**\n         * Restore the download task\n         *\n         * @permission ohos.permission.INTERNET\n         * @param { AsyncCallback<boolean> } callback\n         * @throws { BusinessError } 201 - The permissions check fails.\n         * @throws { BusinessError } 401 - The parameters check fails.\n         * @syscap SystemCapability.MiscServices.Download\n         * @crossplatform\n         * @since 10\n         */\n        /**\n         * Restore the download task\n         *\n         * @permission ohos.permission.INTERNET\n         * @param { AsyncCallback<boolean> } callback\n         * @throws { BusinessError } 201 - The permissions check fails.\n         * @syscap SystemCapability.MiscServices.Download\n         * @crossplatform\n         * @since 12\n         */\n        restore(callback: AsyncCallback<boolean>): void;\n        /**\n         * Restore the download task\n         *\n         * @permission ohos.permission.INTERNET\n         * @returns { Promise<boolean> } the promise returned by the function.\n         * @throws { BusinessError } 201 - The permissions check fails.\n         * @throws { BusinessError } 401 - The parameters check fails.\n         * @syscap SystemCapability.MiscServices.Download\n         * @since 9\n         */\n        /**\n         * Restore the download task\n         *\n         * @permission ohos.permission.INTERNET\n         * @returns { Promise<boolean> } the promise returned by the function.\n         * @throws { BusinessError } 201 - The permissions check fails.\n         * @throws { BusinessError } 401 - The parameters check fails.\n         * @syscap SystemCapability.MiscServices.Download\n         * @crossplatform\n         * @since 10\n         */\n        /**\n         * Restore the download task\n         *\n         * @permission ohos.permission.INTERNET\n         * @returns { Promise<boolean> } the promise returned by the function.\n         * @throws { BusinessError } 201 - The permissions check fails.\n         * @syscap SystemCapability.MiscServices.Download\n         * @crossplatform\n         * @since 12\n         */\n        restore(): Promise<boolean>;\n        /**\n         * Get the download task info.\n         * Obtains the information about this download task.\n         *\n         * @permission ohos.permission.INTERNET\n         * @param { AsyncCallback<DownloadInfo> } callback\n         * @throws { BusinessError } 201 - The permissions check fails.\n         * @throws { BusinessError } 401 - The parameters check fails.\n         * @syscap SystemCapability.MiscServices.Download\n         * @since 9\n         */\n        /**\n         * Get the download task info.\n         * Obtains the information about this download task.\n         *\n         * @permission ohos.permission.INTERNET\n         * @param { AsyncCallback<DownloadInfo> } callback\n         * @throws { BusinessError } 201 - The permissions check fails.\n         * @throws { BusinessError } 401 - The parameters check fails.\n         * @syscap SystemCapability.MiscServices.Download\n         * @crossplatform\n         * @since 10\n         */\n        /**\n         * Get the download task info.\n         * Obtains the information about this download task.\n         *\n         * @permission ohos.permission.INTERNET\n         * @param { AsyncCallback<DownloadInfo> } callback\n         * @throws { BusinessError } 201 - The permissions check fails.\n         * @syscap SystemCapability.MiscServices.Download\n         * @crossplatform\n         * @since 12\n         */\n        getTaskInfo(callback: AsyncCallback<DownloadInfo>): void;\n        /**\n         * Get the download task info.\n         * Obtains the information about this download task.\n         *\n         * @permission ohos.permission.INTERNET\n         * @returns { Promise<DownloadInfo> } the promise returned by the function.\n         * @throws { BusinessError } 201 - The permissions check fails.\n         * @throws { BusinessError } 401 - The parameters check fails.\n         * @syscap SystemCapability.MiscServices.Download\n         * @since 9\n         */\n        /**\n         * Get the download task info.\n         * Obtains the information about this download task.\n         *\n         * @permission ohos.permission.INTERNET\n         * @returns { Promise<DownloadInfo> } the promise returned by the function.\n         * @throws { BusinessError } 201 - The permissions check fails.\n         * @throws { BusinessError } 401 - The parameters check fails.\n         * @syscap SystemCapability.MiscServices.Download\n         * @crossplatform\n         * @since 10\n         */\n        /**\n         * Get the download task info.\n         * Obtains the information about this download task.\n         *\n         * @permission ohos.permission.INTERNET\n         * @returns { Promise<DownloadInfo> } the promise returned by the function.\n         * @throws { BusinessError } 201 - The permissions check fails.\n         * @syscap SystemCapability.MiscServices.Download\n         * @crossplatform\n         * @since 12\n         */\n        getTaskInfo(): Promise<DownloadInfo>;\n        /**\n         * Get mimetype of the download task.\n         * Obtains the MimeType of this download task.\n         *\n         * @permission ohos.permission.INTERNET\n         * @param { AsyncCallback<string> } callback\n         * @throws { BusinessError } 201 - The permissions check fails.\n         * @throws { BusinessError } 401 - The parameters check fails.\n         * @syscap SystemCapability.MiscServices.Download\n         * @since 9\n         */\n        /**\n         * Get mimetype of the download task.\n         * Obtains the MimeType of this download task.\n         *\n         * @permission ohos.permission.INTERNET\n         * @param { AsyncCallback<string> } callback\n         * @throws { BusinessError } 201 - The permissions check fails.\n         * @throws { BusinessError } 401 - The parameters check fails.\n         * @syscap SystemCapability.MiscServices.Download\n         * @crossplatform\n         * @since 10\n         */\n        /**\n         * Get mimetype of the download task.\n         * Obtains the MimeType of this download task.\n         *\n         * @permission ohos.permission.INTERNET\n         * @param { AsyncCallback<string> } callback\n         * @throws { BusinessError } 201 - The permissions check fails.\n         * @syscap SystemCapability.MiscServices.Download\n         * @crossplatform\n         * @since 12\n         */\n        getTaskMimeType(callback: AsyncCallback<string>): void;\n        /**\n         * Get mimetype of the download task.\n         * Obtains the MimeType of this download task.\n         *\n         * @permission ohos.permission.INTERNET\n         * @returns { Promise<string> } the promise returned by the function.\n         * @throws { BusinessError } 201 - The permissions check fails.\n         * @throws { BusinessError } 401 - The parameters check fails.\n         * @syscap SystemCapability.MiscServices.Download\n         * @since 9\n         */\n        /**\n         * Get mimetype of the download task.\n         * Obtains the MimeType of this download task.\n         *\n         * @permission ohos.permission.INTERNET\n         * @returns { Promise<string> } the promise returned by the function.\n         * @throws { BusinessError } 201 - The permissions check fails.\n         * @throws { BusinessError } 401 - The parameters check fails.\n         * @syscap SystemCapability.MiscServices.Download\n         * @crossplatform\n         * @since 10\n         */\n        /**\n         * Get mimetype of the download task.\n         * Obtains the MimeType of this download task.\n         *\n         * @permission ohos.permission.INTERNET\n         * @returns { Promise<string> } the promise returned by the function.\n         * @throws { BusinessError } 201 - The permissions check fails.\n         * @syscap SystemCapability.MiscServices.Download\n         * @crossplatform\n         * @since 12\n         */\n        getTaskMimeType(): Promise<string>;\n    }\n    /**\n     * File data structure.\n     * Defines the file list in UploadConfig.\n     *\n     * @interface File\n     * @syscap SystemCapability.MiscServices.Download\n     * @since 6\n     * @name File\n     */\n    /**\n     * File data structure.\n     * Defines the file list in UploadConfig.\n     *\n     * @typedef File\n     * @syscap SystemCapability.MiscServices.Download\n     * @crossplatform\n     * @since 10\n     */\n    interface File {\n        /**\n         * When multipart is submitted, the file name in the request header.\n         *\n         * @syscap SystemCapability.MiscServices.Download\n         * @since 6\n         */\n        /**\n         * When multipart is submitted, the file name in the request header.\n         *\n         * @type { string }\n         * @syscap SystemCapability.MiscServices.Download\n         * @crossplatform\n         * @since 10\n         */\n        filename: string;\n        /**\n         * When multipart is submitted, the name of the form item. The default is file.\n         *\n         * @syscap SystemCapability.MiscServices.Download\n         * @since 6\n         */\n        /**\n         * When multipart is submitted, the name of the form item. The default is file.\n         *\n         * @type { string }\n         * @syscap SystemCapability.MiscServices.Download\n         * @crossplatform\n         * @since 10\n         */\n        name: string;\n        /**\n         * The local storage path of the file (please refer to the storage directory definition for path usage).\n         *\n         * @syscap SystemCapability.MiscServices.Download\n         * @since 6\n         */\n        /**\n         * The local storage path of the file (please refer to the storage directory definition for path usage).\n         *\n         * @type { string }\n         * @syscap SystemCapability.MiscServices.Download\n         * @crossplatform\n         * @since 10\n         */\n        uri: string;\n        /**\n         * The content type of the file is obtained by default according to the suffix of the file name or path.\n         *\n         * @syscap SystemCapability.MiscServices.Download\n         * @since 6\n         */\n        /**\n         * The content type of the file is obtained by default according to the suffix of the file name or path.\n         *\n         * @type { string }\n         * @syscap SystemCapability.MiscServices.Download\n         * @crossplatform\n         * @since 10\n         */\n        type: string;\n    }\n    /**\n     * RequestData data structure.\n     * Defines the form data in UploadConfig.\n     *\n     * @interface RequestData\n     * @syscap SystemCapability.MiscServices.Download\n     * @since 6\n     * @name RequestData\n     */\n    /**\n     * RequestData data structure.\n     * Defines the form data in UploadConfig.\n     *\n     * @typedef RequestData\n     * @syscap SystemCapability.MiscServices.Download\n     * @crossplatform\n     * @since 10\n     */\n    interface RequestData {\n        /**\n         * Represents the name of the form element.\n         *\n         * @syscap SystemCapability.MiscServices.Download\n         * @since 6\n         */\n        /**\n         * Represents the name of the form element.\n         *\n         * @type { string }\n         * @syscap SystemCapability.MiscServices.Download\n         * @crossplatform\n         * @since 10\n         */\n        name: string;\n        /**\n         * Represents the value of the form element.\n         *\n         * @syscap SystemCapability.MiscServices.Download\n         * @since 6\n         */\n        /**\n         * Represents the value of the form element.\n         *\n         * @type { string }\n         * @syscap SystemCapability.MiscServices.Download\n         * @crossplatform\n         * @since 10\n         */\n        value: string;\n    }\n    /**\n     * UploadConfig data structure.\n     * Describes the configuration of an upload task.\n     *\n     * @interface UploadConfig\n     * @syscap SystemCapability.MiscServices.Upload\n     * @since 6\n     * @name UploadConfig\n     */\n    /**\n     * UploadConfig data structure.\n     * Describes the configuration of an upload task.\n     *\n     * @typedef UploadConfig\n     * @syscap SystemCapability.MiscServices.Upload\n     * @crossplatform\n     * @since 10\n     */\n    interface UploadConfig {\n        /**\n         * Resource address.\n         * Verification rule: Starting with http (s)://and with a length not exceeding 2048 characters.\n         *\n         * @syscap SystemCapability.MiscServices.Upload\n         * @since 6\n         */\n        /**\n         * Resource address.\n         * Verification rule: Starting with http (s)://and with a length not exceeding 2048 characters.\n         *\n         * @type { string }\n         * @syscap SystemCapability.MiscServices.Upload\n         * @crossplatform\n         * @since 10\n         */\n        /**\n         * Resource address.\n         * Verification rule: Starting with http (s)://and with a length not exceeding 8192 characters.\n         *\n         * @type { string }\n         * @syscap SystemCapability.MiscServices.Upload\n         * @crossplatform\n         * @since 15\n         */\n        url: string;\n        /**\n         * Adds an HTTP or HTTPS header to be included with the upload request.\n         *\n         * @syscap SystemCapability.MiscServices.Upload\n         * @since 6\n         */\n        /**\n         * Adds an HTTP or HTTPS header to be included with the upload request.\n         *\n         * @type { Object }\n         * @syscap SystemCapability.MiscServices.Upload\n         * @crossplatform\n         * @since 10\n         */\n        header: Object;\n        /**\n         * Request method: POST, PUT. The default POST.\n         *\n         * @syscap SystemCapability.MiscServices.Upload\n         * @since 6\n         */\n        /**\n         * Request method: POST, PUT. The default POST.\n         *\n         * @type { string }\n         * @syscap SystemCapability.MiscServices.Upload\n         * @crossplatform\n         * @since 10\n         */\n        method: string;\n        /**\n         * The index of paths for a task.\n         * Usually used for a continuous job.\n         * The default is 0.\n         *\n         * @type { ?number }\n         * @syscap SystemCapability.MiscServices.Upload\n         * @since 11\n         */\n        index?: number;\n        /**\n         * The start point of a file.\n         * Usually used for a continuous job.\n         * It will start read at the point in upload.\n         * The default is 0.\n         *\n         * @type { ?number }\n         * @syscap SystemCapability.MiscServices.Upload\n         * @since 11\n         */\n        begins?: number;\n        /**\n         * The end point of a file.\n         * Usually used for a continuous job.\n         * It will end read at the point in upload.\n         * The default is -1 indicating the end of the data for upload.\n         *\n         * @type { ?number }\n         * @syscap SystemCapability.MiscServices.Upload\n         * @since 11\n         */\n        ends?: number;\n        /**\n         * A list of files to be uploaded. Please use multipart/form-data to submit.\n         *\n         * @syscap SystemCapability.MiscServices.Upload\n         * @since 6\n         */\n        /**\n         * A list of files to be uploaded. Please use multipart/form-data to submit.\n         *\n         * @type { Array<File> }\n         * @syscap SystemCapability.MiscServices.Upload\n         * @crossplatform\n         * @since 10\n         */\n        files: Array<File>;\n        /**\n         * The requested form data in the request body.\n         *\n         * @syscap SystemCapability.MiscServices.Upload\n         * @since 6\n         */\n        /**\n         * The requested form data in the request body.\n         *\n         * @type { Array<RequestData> }\n         * @syscap SystemCapability.MiscServices.Upload\n         * @crossplatform\n         * @since 10\n         */\n        data: Array<RequestData>;\n    }\n    /**\n     * TaskState data structure.\n     * Implements a TaskState object.\n     *\n     * @interface TaskState\n     * @syscap SystemCapability.MiscServices.Upload\n     * @since 9\n     * @name TaskState\n     */\n    /**\n     * TaskState data structure.\n     * Implements a TaskState object.\n     *\n     * @typedef TaskState\n     * @syscap SystemCapability.MiscServices.Upload\n     * @crossplatform\n     * @since 10\n     */\n    interface TaskState {\n        /**\n         * Upload file path.\n         *\n         * @syscap SystemCapability.MiscServices.Upload\n         * @since 9\n         */\n        /**\n         * Upload file path.\n         *\n         * @type { string }\n         * @syscap SystemCapability.MiscServices.Upload\n         * @crossplatform\n         * @since 10\n         */\n        path: string;\n        /**\n         * Return value of an upload task.\n         * The value 0 means that the task is successful,\n         * and other values means that the task fails.\n         *\n         * @syscap SystemCapability.MiscServices.Upload\n         * @since 9\n         */\n        /**\n         * Return value of an upload task.\n         * The value 0 means that the task is successful,\n         * and other values means that the task fails.\n         *\n         * @type { number }\n         * @syscap SystemCapability.MiscServices.Upload\n         * @crossplatform\n         * @since 10\n         */\n        responseCode: number;\n        /**\n         * Upload task information.\n         *\n         * @syscap SystemCapability.MiscServices.Upload\n         * @since 9\n         */\n        /**\n         * Upload task information.\n         *\n         * @type { string }\n         * @syscap SystemCapability.MiscServices.Upload\n         * @crossplatform\n         * @since 10\n         */\n        message: string;\n    }\n    /**\n     * Upload task interface.\n     * Implements file uploads.\n     *\n     * @interface UploadTask\n     * @syscap SystemCapability.MiscServices.Download\n     * @since 6\n     */\n    /**\n     * Upload task interface.\n     * Implements file uploads.\n     *\n     * @typedef UploadTask\n     * @syscap SystemCapability.MiscServices.Download\n     * @crossplatform\n     * @since 10\n     */\n    interface UploadTask {\n        /**\n         * Called when the current upload session is in process.\n         * Subscribes to upload progress events.\n         *\n         * @param { 'progress' } type progress Indicates the upload task progress.\n         * @param { function } callback\n         *        The callback function for the upload progress change event\n         *        uploadedSize The length of uploaded data, in bytes\n         *        totalSize The length of data expected to be uploaded, in bytes.\n         * @syscap SystemCapability.MiscServices.Upload\n         * @since 6\n         */\n        /**\n         * Called when the current upload session is in process.\n         * Subscribes to upload progress events.\n         *\n         * @param { 'progress' } type progress Indicates the upload task progress.\n         * @param { function } callback\n         *        The callback function for the upload progress change event\n         *        uploadedSize The length of uploaded data, in bytes\n         *        totalSize The length of data expected to be uploaded, in bytes.\n         * @syscap SystemCapability.MiscServices.Upload\n         * @crossplatform\n         * @since 10\n         */\n        /**\n         * Called when the current upload session is in process.\n         * Subscribes to upload progress events.\n         *\n         * @param { 'progress' } type progress Indicates the upload task progress.\n         * @param { function } callback\n         * <br>The callback function for the upload progress change event\n         * <br>uploadedSize The length of uploaded data, in bytes\n         * <br>totalSize The length of data expected to be uploaded, in bytes.\n         * @throws { BusinessError } 401 - The parameters check fails. Possible causes: 1. Missing mandatory parameters.\n         * <br>2. Incorrect parameter type. 3. Parameter verification failed.\n         * @syscap SystemCapability.MiscServices.Upload\n         * @crossplatform\n         * @since 12\n         */\n        on(type: 'progress', callback: (uploadedSize: number, totalSize: number) => void): void;\n        /**\n         * Called when the current upload session is in process.\n         * Unsubscribes from download progress events.\n         *\n         * @param { 'progress' } type progress Indicates the upload task progress.\n         * @param { function } [callback]\n         *        The callback function for the upload progress change event\n         *        uploadedSize The length of uploaded data, in bytes\n         *        totalSize The length of data expected to be uploaded, in bytes.\n         * @syscap SystemCapability.MiscServices.Upload\n         * @since 6\n         */\n        /**\n         * Called when the current upload session is in process.\n         * Unsubscribes from download progress events.\n         *\n         * @param { 'progress' } type progress Indicates the upload task progress.\n         * @param { function } [callback]\n         *        The callback function for the upload progress change event\n         *        uploadedSize The length of uploaded data, in bytes\n         *        totalSize The length of data expected to be uploaded, in bytes.\n         * @syscap SystemCapability.MiscServices.Upload\n         * @crossplatform\n         * @since 10\n         */\n        /**\n         * Called when the current upload session is in process.\n         * Unsubscribes from download progress events.\n         *\n         * @param { 'progress' } type progress Indicates the upload task progress.\n         * @param { function } [callback]\n         * <br>The callback function for the upload progress change event\n         * <br>uploadedSize The length of uploaded data, in bytes\n         * <br>totalSize The length of data expected to be uploaded, in bytes.\n         * @throws { BusinessError } 401 - The parameters check fails. Possible causes: 1. Missing mandatory parameters.\n         * <br>2. Incorrect parameter type. 3. Parameter verification failed.\n         * @syscap SystemCapability.MiscServices.Upload\n         * @crossplatform\n         * @since 12\n         */\n        off(type: 'progress', callback?: (uploadedSize: number, totalSize: number) => void): void;\n        /**\n         * Called when the header of the current upload session has been received.\n         * Subscribes to HTTP response events for the upload task.\n         *\n         * @param { 'headerReceive' } type headerReceive Indicates the upload task headed receive.\n         * @param { function } callback The callback function for the HTTP Response Header event\n         *        header HTTP Response Header returned by the developer server.\n         * @syscap SystemCapability.MiscServices.Upload\n         * @since 7\n         */\n        /**\n         * Called when the header of the current upload session has been received.\n         * Subscribes to HTTP response events for the upload task.\n         *\n         * @param { 'headerReceive' } type headerReceive Indicates the upload task headed receive.\n         * @param { function } callback The callback function for the HTTP Response Header event\n         *        header HTTP Response Header returned by the developer server.\n         * @syscap SystemCapability.MiscServices.Upload\n         * @crossplatform\n         * @since 10\n         */\n        /**\n         * Called when the header of the current upload session has been received.\n         * Subscribes to HTTP response events for the upload task.\n         *\n         * @param { 'headerReceive' } type headerReceive Indicates the upload task headed receive.\n         * @param { function } callback The callback function for the HTTP Response Header event\n         * <br>header HTTP Response Header returned by the developer server.\n         * @throws { BusinessError } 401 - The parameters check fails. Possible causes: 1. Missing mandatory parameters.\n         * <br>2. Incorrect parameter type. 3. Parameter verification failed.\n         * @syscap SystemCapability.MiscServices.Upload\n         * @crossplatform\n         * @since 12\n         */\n        on(type: 'headerReceive', callback: (header: object) => void): void;\n        /**\n         * Called when the header of the current upload session has been received.\n         * Unsubscribes from HTTP response events for the upload task.\n         *\n         * @param { 'headerReceive' } type headerReceive Indicates the upload task headed receive.\n         * @param { function } [callback] The callback function for the HTTP Response Header event\n         *        header HTTP Response Header returned by the developer server.\n         * @syscap SystemCapability.MiscServices.Upload\n         * @since 7\n         */\n        /**\n         * Called when the header of the current upload session has been received.\n         * Unsubscribes from HTTP response events for the upload task.\n         *\n         * @param { 'headerReceive' } type headerReceive Indicates the upload task headed receive.\n         * @param { function } [callback] The callback function for the HTTP Response Header event\n         *        header HTTP Response Header returned by the developer server.\n         * @syscap SystemCapability.MiscServices.Upload\n         * @crossplatform\n         * @since 10\n         */\n        /**\n         * Called when the header of the current upload session has been received.\n         * Unsubscribes from HTTP response events for the upload task.\n         *\n         * @param { 'headerReceive' } type headerReceive Indicates the upload task headed receive.\n         * @param { function } [callback] The callback function for the HTTP Response Header event\n         * <br>header HTTP Response Header returned by the developer server.\n         * @throws { BusinessError } 401 - The parameters check fails. Possible causes: 1. Missing mandatory parameters.\n         * <br>2. Incorrect parameter type. 3. Parameter verification failed.\n         * @syscap SystemCapability.MiscServices.Upload\n         * @crossplatform\n         * @since 12\n         */\n        off(type: 'headerReceive', callback?: (header: object) => void): void;\n        /**\n         * Called when the current upload session complete or fail.\n         *\n         * @param { 'complete' | 'fail' } type Indicates the upload session event type\n         *        complete: upload task completed\n         *        fail: upload task failed\n         * @param { Callback<Array<TaskState>> } callback The callback function for the upload complete or fail change event.\n         * @syscap SystemCapability.MiscServices.Upload\n         * @since 9\n         */\n        /**\n         * Called when the current upload session complete or fail.\n         *\n         * @param { 'complete' | 'fail' } type Indicates the upload session event type\n         *        complete: upload task completed\n         *        fail: upload task failed\n         * @param { Callback<Array<TaskState>> } callback The callback function for the upload complete or fail change event.\n         * @syscap SystemCapability.MiscServices.Upload\n         * @crossplatform\n         * @since 10\n         */\n        /**\n         * Called when the current upload session complete or fail.\n         *\n         * @param { 'complete' | 'fail' } type Indicates the upload session event type\n         * <br>complete: upload task completed\n         * <br>fail: upload task failed\n         * @param { Callback<Array<TaskState>> } callback The callback function for the upload complete or fail change event.\n         * @throws { BusinessError } 401 - The parameters check fails. Possible causes: 1. Missing mandatory parameters.\n         * <br>2. Incorrect parameter type. 3. Parameter verification failed.\n         * @syscap SystemCapability.MiscServices.Upload\n         * @crossplatform\n         * @since 12\n         */\n        on(type: 'complete' | 'fail', callback: Callback<Array<TaskState>>): void;\n        /**\n         * Called when the current upload session complete or fail.\n         *\n         * @param { 'complete' | 'fail' } type Indicates the upload session event type\n         *        complete: upload task completed\n         *         fail: upload task failed\n         * @param { Callback<Array<TaskState>> } [callback]\n         * @syscap SystemCapability.MiscServices.Upload\n         * @since 9\n         */\n        /**\n         * Called when the current upload session complete or fail.\n         *\n         * @param { 'complete' | 'fail' } type Indicates the upload session event type\n         *        complete: upload task completed\n         *         fail: upload task failed\n         * @param { Callback<Array<TaskState>> } [callback]\n         * @syscap SystemCapability.MiscServices.Upload\n         * @crossplatform\n         * @since 10\n         */\n        /**\n         * Called when the current upload session complete or fail.\n         *\n         * @param { 'complete' | 'fail' } type Indicates the upload session event type\n         * <br>complete: upload task completed\n         * <br>fail: upload task failed\n         * @param { Callback<Array<TaskState>> } [callback]\n         * @throws { BusinessError } 401 - The parameters check fails. Possible causes: 1. Missing mandatory parameters.\n         * <br>2. Incorrect parameter type. 3. Parameter verification failed.\n         * @syscap SystemCapability.MiscServices.Upload\n         * @crossplatform\n         * @since 12\n         */\n        off(type: 'complete' | 'fail', callback?: Callback<Array<TaskState>>): void;\n        /**\n         * Deletes an upload session.\n         *\n         * @permission ohos.permission.INTERNET\n         * @param { AsyncCallback<boolean> } callback Indicates asynchronous invoking Result.\n         * @throws { BusinessError } 201 - The permissions check fails.\n         * @syscap SystemCapability.MiscServices.Upload\n         * @since 6\n         * @deprecated since 9\n         * @useinstead ohos.request.delete\n         */\n        remove(callback: AsyncCallback<boolean>): void;\n        /**\n         * Deletes an upload session.\n         *\n         * @permission ohos.permission.INTERNET\n         * @returns { Promise<boolean> } the promise returned by the function.\n         * @throws { BusinessError } 201 - The permissions check fails.\n         * @syscap SystemCapability.MiscServices.Upload\n         * @since 6\n         * @deprecated since 9\n         * @useinstead ohos.request.delete\n         */\n        remove(): Promise<boolean>;\n        /**\n         * Delete the upload task\n         *\n         * @permission ohos.permission.INTERNET\n         * @param { AsyncCallback<boolean> } callback\n         * @throws { BusinessError } 201 - The permissions check fails.\n         * @throws { BusinessError } 401 - The parameters check fails.\n         * @syscap SystemCapability.MiscServices.Upload\n         * @since 9\n         */\n        /**\n         * Delete the upload task\n         *\n         * @permission ohos.permission.INTERNET\n         * @param { AsyncCallback<boolean> } callback\n         * @throws { BusinessError } 201 - The permissions check fails.\n         * @throws { BusinessError } 401 - The parameters check fails.\n         * @syscap SystemCapability.MiscServices.Upload\n         * @crossplatform\n         * @since 10\n         */\n        /**\n         * Delete the upload task\n         *\n         * @permission ohos.permission.INTERNET\n         * @param { AsyncCallback<boolean> } callback\n         * @throws { BusinessError } 201 - The permissions check fails.\n         * @syscap SystemCapability.MiscServices.Upload\n         * @crossplatform\n         * @since 12\n         */\n        delete(callback: AsyncCallback<boolean>): void;\n        /**\n         * Delete the upload task\n         *\n         * @permission ohos.permission.INTERNET\n         * @returns { Promise<boolean> } the promise returned by the function.\n         * @throws { BusinessError } 201 - The permissions check fails.\n         * @throws { BusinessError } 401 - The parameters check fails.\n         * @syscap SystemCapability.MiscServices.Upload\n         * @since 9\n         */\n        /**\n         * Delete the upload task\n         *\n         * @permission ohos.permission.INTERNET\n         * @returns { Promise<boolean> } the promise returned by the function.\n         * @throws { BusinessError } 201 - The permissions check fails.\n         * @throws { BusinessError } 401 - The parameters check fails.\n         * @syscap SystemCapability.MiscServices.Upload\n         * @crossplatform\n         * @since 10\n         */\n        /**\n         * Delete the upload task\n         *\n         * @permission ohos.permission.INTERNET\n         * @returns { Promise<boolean> } the promise returned by the function.\n         * @throws { BusinessError } 201 - The permissions check fails.\n         * @syscap SystemCapability.MiscServices.Upload\n         * @crossplatform\n         * @since 12\n         */\n        delete(): Promise<boolean>;\n    }\n    /**\n     * The request agent api.\n     * Supports \"background\" and \"frontend\" tasks as while.\n     * Though \"background\" and \"frontend\" here do not the same with process's concept.\n     * All tasks will be executed at request manager service and recorded.\n     * Background tasks is for concurrent transfer, such as caching videos for a later play.\n     * Frontend tasks is for instant transfer, such as submitting forms for a consumption bill.\n     * Background tasks use notification to tell user tasks' status information.\n     * Frontend tasks use callback to tell caller tasks' status information.\n     * Background has some automatically restore mechanism.\n     * Frontend tasks controlled by caller.\n     * Uses `multipart/form-data` in client request for upload.\n     * A `Content-Disposition: attachment; filename=<filename>` response from server leads to download.\n     * More details, please see the architecture documents of the request subsystem.\n     *\n     * @namespace agent\n     * @syscap SystemCapability.Request.FileTransferAgent\n     * @since 10\n     */\n    /**\n     * The request agent api.\n     * Supports \"background\" and \"frontend\" tasks as while.\n     * Though \"background\" and \"frontend\" here do not the same with process's concept.\n     * All tasks will be executed at request manager service and recorded.\n     * Background tasks is for concurrent transfer, such as caching videos for a later play.\n     * Frontend tasks is for instant transfer, such as submitting forms for a consumption bill.\n     * Background tasks use notification to tell user tasks' status information.\n     * Frontend tasks use callback to tell caller tasks' status information.\n     * Background has some automatically restore mechanism.\n     * Frontend tasks controlled by caller.\n     * Uses `multipart/form-data` in client request for upload.\n     * A `Content-Disposition: attachment; filename=<filename>` response from server leads to download.\n     * More details, please see the architecture documents of the request subsystem.\n     * Only front-end mode is supported in cross-platform scenarios.\n     *\n     * @namespace agent\n     * @syscap SystemCapability.Request.FileTransferAgent\n     * @crossplatform\n     * @atomicservice\n     * @since 11\n     */\n    namespace agent {\n        /**\n         * The action options.\n         *\n         * @enum { number } Action\n         * @syscap SystemCapability.Request.FileTransferAgent\n         * @since 10\n         */\n        /**\n         * The action options.\n         *\n         * @enum { number } Action\n         * @syscap SystemCapability.Request.FileTransferAgent\n         * @crossplatform\n         * @atomicservice\n         * @since 11\n         */\n        enum Action {\n            /**\n             * Indicates download task.\n             *\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * Indicates download task.\n             *\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @atomicservice\n             * @since 11\n             */\n            DOWNLOAD,\n            /**\n             * Indicates upload task.\n             *\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * Indicates upload task.\n             *\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @atomicservice\n             * @since 11\n             */\n            UPLOAD\n        }\n        /**\n         * The mode options.\n         *\n         * @enum { number } Mode\n         * @syscap SystemCapability.Request.FileTransferAgent\n         * @since 10\n         */\n        /**\n         * The mode options.\n         *\n         * @enum { number } Mode\n         * @syscap SystemCapability.Request.FileTransferAgent\n         * @crossplatform\n         * @atomicservice\n         * @since 11\n         */\n        enum Mode {\n            /**\n             * Indicates background task.\n             *\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * Indicates background task.\n             *\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @atomicservice\n             * @since 11\n             */\n            BACKGROUND,\n            /**\n             * Indicates foreground task.\n             *\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * Indicates foreground task.\n             *\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @atomicservice\n             * @since 11\n             */\n            FOREGROUND\n        }\n        /**\n         * The network options.\n         *\n         * @enum { number } Network\n         * @syscap SystemCapability.Request.FileTransferAgent\n         * @since 10\n         */\n        /**\n         * The network options.\n         *\n         * @enum { number } Network\n         * @syscap SystemCapability.Request.FileTransferAgent\n         * @crossplatform\n         * @atomicservice\n         * @since 11\n         */\n        enum Network {\n            /**\n             * Indicates no restriction on network type.\n             *\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * Indicates no restriction on network type.\n             *\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @atomicservice\n             * @since 11\n             */\n            ANY,\n            /**\n             * Indicates Wi-Fi only.\n             *\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * Indicates Wi-Fi only.\n             *\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @atomicservice\n             * @since 11\n             */\n            WIFI,\n            /**\n             * Indicates cellular only.\n             *\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * Indicates cellular only.\n             *\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @atomicservice\n             * @since 11\n             */\n            CELLULAR\n        }\n        /**\n         * Broadcast events for the request.\n         *\n         * @enum { string } BroadcastEvent\n         * @syscap SystemCapability.Request.FileTransferAgent\n         * @since 11\n         */\n        enum BroadcastEvent {\n            /**\n             * Completion event for the task.\n             * The code in the commonEventData can only be \"0x40\"(COMPLETE) or \"0x41\"(FAILED), same as \"State\".\n             * The data in the commonEventData contains the id of the task.\n             *\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 11\n             */\n            COMPLETE = 'ohos.request.event.COMPLETE'\n        }\n        /**\n         * The file information for a form item.\n         *\n         * @typedef FileSpec\n         * @syscap SystemCapability.Request.FileTransferAgent\n         * @since 10\n         */\n        /**\n         * The file information for a form item.\n         *\n         * @typedef FileSpec\n         * @syscap SystemCapability.Request.FileTransferAgent\n         * @crossplatform\n         * @atomicservice\n         * @since 11\n         */\n        interface FileSpec {\n            /**\n             * A relative path string, like \"./xxx/yyy/zzz.html\", \"xxx/yyy/zzz.html\", in the caller's cache directory.\n             * Provides the file information of a table item.\n             *\n             * @type { string }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * A relative path string, like \"./xxx/yyy/zzz.html\", \"xxx/yyy/zzz.html\", in the caller's cache directory.\n             * Provides the file information of a table item.\n             *\n             * @type { string }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @atomicservice\n             * @since 11\n             */\n            /**\n             * The path to save the uploaded file.\n             * Currently support:\n             * 1: relative path, like \"./xxx/yyy/zzz.html\", \"xxx/yyy/zzz.html\", under caller's cache folder.\n             * 2: internal protocol path, starting with \"internal://\", like \"internal://cache/path/to/file.txt\".\n             * 3: application storage path, only the base directory and its subdirectories are supported, like \"/data/storage/el1/base/path/to/file.txt\".\n             * 4: file protocol path with self bundle name, only the base directory and its subdirectories are supported, like \"file://com.example.test/data/storage/el2/base/file.txt\".\n             * 5: user file url, like \"file://media/Photo/path/to/file.png\".\n             *\n             * @type { string }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @atomicservice\n             * @since 12\n             */\n            path: string;\n            /**\n             * The MIME type of the file.\n             * The default is obtained by the suffix of the filename.\n             *\n             * @type { ?string }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * The MIME type of the file.\n             * The default is obtained by the suffix of the filename.\n             *\n             * @type { ?string }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @atomicservice\n             * @since 11\n             * @deprecated since 18\n             * @useinstead ohos.request.agent.FileSpec.contentType\n             */\n            mimeType?: string;\n            /**\n             * Sets the content-type field of the part.\n             * The default is obtained by the suffix of the filename.\n             *\n             * @type { ?string }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 18\n             */\n            contentType?: string;\n            /**\n             * The filename, the default is obtained by path.\n             *\n             * @type { ?string }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * The filename, the default is obtained by path.\n             *\n             * @type { ?string }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @atomicservice\n             * @since 11\n             */\n            filename?: string;\n            /**\n             * The extras for the file information.\n             * This parameter is not included in HTTP requests.\n             *\n             * @type { ?object }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * The extras for the file information.\n             * This parameter is not included in HTTP requests.\n             *\n             * @type { ?object }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @atomicservice\n             * @since 11\n             */\n            extras?: object;\n        }\n        /**\n         * The form item information for a task.\n         *\n         * @typedef FormItem\n         * @syscap SystemCapability.Request.FileTransferAgent\n         * @since 10\n         */\n        /**\n         * The form item information for a task.\n         *\n         * @typedef FormItem\n         * @syscap SystemCapability.Request.FileTransferAgent\n         * @crossplatform\n         * @atomicservice\n         * @since 11\n         */\n        interface FormItem {\n            /**\n             * The item's name.\n             *\n             * @type { string }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * The item's name.\n             *\n             * @type { string }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @atomicservice\n             * @since 11\n             */\n            name: string;\n            /**\n             * The item's value.\n             *\n             * @type { string | FileSpec | Array<FileSpec> }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * The item's value.\n             *\n             * @type { string | FileSpec | Array<FileSpec> }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @atomicservice\n             * @since 11\n             */\n            value: string | FileSpec | Array<FileSpec>;\n        }\n        /**\n         * Describes the custom information of the notification bar.\n         *\n         * @typedef Notification\n         * @syscap SystemCapability.Request.FileTransferAgent\n         * @since 15\n         */\n        interface Notification {\n            /**\n             * The title of the notification.\n             * If not specified, use default style instead.\n             * The maximum size of title is 1024 bytes.\n             *\n             * @type { ?string }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 15\n             */\n            title?: string;\n            /**\n             * The text of the notification.\n             * If not specified, use the file name of the task instead.\n             * The maximum size of text is 3072 bytes.\n             *\n             * @type { ?string }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 15\n             */\n            text?: string;\n        }\n        /**\n         * Options of the minimum speed of the task.\n         *\n         * @typedef MinSpeed\n         * @syscap SystemCapability.Request.FileTransferAgent\n         * @since 20\n         */\n        interface MinSpeed {\n            /**\n             * The minimum speed of the task, in bytes per second.\n             * If the speed of the task is lower than this value for a period of time, the task fails.\n             * If the value is set to 0, no minimum speed limit will be activated.\n             *\n             * @type { number }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 20\n             */\n            speed: number;\n            /**\n             * Duration of the speed which is allowed to be below the minimum speed, in seconds.\n             * If the speed of the task is lower than this value for a period of time, the task fails.\n             * If the value is set to 0, no minimum speed limit will be activated.\n             *\n             * @type { number }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 20\n             */\n            duration: number;\n        }\n        /**\n         * Options of the custom task timeout.\n         *\n         * @typedef Timeout\n         * @syscap SystemCapability.Request.FileTransferAgent\n         * @since 20\n         */\n        interface Timeout {\n            /**\n             * The connection timeout of the task, in seconds.\n             * Connection timeout is the maximum time required for a client and a server to establish a connection.\n             * If this value is not specified, use default value instead. The default value is 60 seconds.\n             * The minimum value allowed is 1 second.\n             *\n             * @type { ?number }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 20\n             */\n            connectionTimeout?: number;\n            /**\n             * Total timeout of the task, in seconds.\n             * Total timeout includes the time to establish a connection, send a request and receive a response.\n             * If this value is not specified, use default value instead. The default value is 604,800 seconds(1 week).\n             * The minimum value allowed is 1 second.\n             * The maximum value allowed is 604,800 seconds(1 week).\n             *\n             * @type { ?number }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 20\n             */\n            totalTimeout?: number;\n        }\n        /**\n         * The configurations for a task.\n         * Provides the configuration information of an upload or download task.\n         * Using a flexible configuration for clear upload and download functions.\n         * If without emphasis, an option is for any task.\n         *\n         * @typedef Config\n         * @syscap SystemCapability.Request.FileTransferAgent\n         * @since 10\n         */\n        /**\n         * The configurations for a task.\n         * Provides the configuration information of an upload or download task.\n         * Using a flexible configuration for clear upload and download functions.\n         * If without emphasis, an option is for any task.\n         *\n         * @typedef Config\n         * @syscap SystemCapability.Request.FileTransferAgent\n         * @crossplatform\n         * @atomicservice\n         * @since 11\n         */\n        interface Config {\n            /**\n             * The task action, upload or download.\n             *\n             * @type { Action }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * The task action, upload or download.\n             *\n             * @type { Action }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @atomicservice\n             * @since 11\n             */\n            action: Action;\n            /**\n             * The Universal Resource Locator for a task.\n             * Starting with http(s)://\n             * The maximum length is 2048 characters.\n             * Using raw `url` option, even url parameters in it.\n             *\n             * @type { string }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * The Universal Resource Locator for a task.\n             * The maximum length is 2048 characters.\n             * Using raw `url` option, even url parameters in it.\n             *\n             * @type { string }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @atomicservice\n             * @since 11\n             */\n            /**\n             * The Universal Resource Locator for a task.\n             * The maximum length is 8192 characters.\n             * Using raw `url` option, even url parameters in it.\n             *\n             * @type { string }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @atomicservice\n             * @since 15\n             */\n            url: string;\n            /**\n             * The title for a task, give a meaningful title please.\n             * The maximum length is 256 characters.\n             * The default is the same with its action.\n             *\n             * @type { ?string }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * The title for a task, give a meaningful title please.\n             * The maximum length is 256 characters.\n             * The default is upload or download, consistent with its action.\n             *\n             * @type { ?string }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @atomicservice\n             * @since 11\n             */\n            title?: string;\n            /**\n             * The details for a task.\n             * The maximum length is 1024 characters.\n             * The default is empty string.\n             *\n             * @type { ?string }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * The details for a task.\n             * The maximum length is 1024 characters.\n             * The default is empty string.\n             *\n             * @type { ?string }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @atomicservice\n             * @since 11\n             */\n            description?: string;\n            /**\n             * Indicates task's mode.\n             * The default is background.\n             * For frontend task, it has callbacks.\n             * For background task, it has notifications and fallback.\n             *\n             * @type { ?Mode }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * Indicates task's mode.\n             * The default is BACKGROUND.\n             * For frontend task, it has callbacks.\n             * For background task, it has notifications and fallback.\n             * The cross-platform default is FOREGROUND.\n             *\n             * @type { ?Mode }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @atomicservice\n             * @since 11\n             */\n            mode?: Mode;\n            /**\n             * The solution choice when path already exists during download.\n             * Currently support:\n             * true, rewrite the existed file;\n             * false, go to fail.\n             *\n             * @type { ?boolean }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * The solution choice when path already exists during download.\n             * The default is false.\n             * Currently support:\n             * true, rewrite the existed file;\n             * false, go to fail.\n             *\n             * @type { ?boolean }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @atomicservice\n             * @since 11\n             */\n            overwrite?: boolean;\n            /**\n             * The HTTP standard method for upload or download: GET/POST/PUT.\n             * Case insensitive.\n             * For upload, use PUT/POST, the default is PUT.\n             * For download, use GET/POST, the default is GET.\n             *\n             * @type { ?string }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * The HTTP standard method for upload or download: GET/POST/PUT.\n             * Case insensitive.\n             * For upload, use PUT/POST, the default is PUT.\n             * For download, use GET/POST, the default is GET.\n             *\n             * @type { ?string }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @atomicservice\n             * @since 11\n             */\n            method?: string;\n            /**\n             * The HTTP headers.\n             * For upload request, the `Content-Type` is forced to `multipart/form-data`.\n             * For download request, the default `Content-Type` is `application/json`.\n             *\n             * @type { ?object }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * The HTTP headers.\n             * For upload request, the `Content-Type` is forced to `multipart/form-data`.\n             * For download request, the default `Content-Type` is `application/json`.\n             *\n             * @type { ?object }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @atomicservice\n             * @since 11\n             */\n            headers?: object;\n            /**\n             * The arguments, it can be any text, uses json usually.\n             * For download, it can be raw string, the default is empty string.\n             * For upload, it can be form items, the default is a empty form.\n             * There must be one `FileSpec` item at least or will be a parameter error.\n             *\n             * @type { ?(string | Array<FormItem>) }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * The arguments, it can be any text, uses json usually.\n             * For download, it can be raw string, the default is empty string.\n             * For upload, it can be form items, the default is a empty form.\n             * There must be one `FileSpec` item at least or will be a parameter error.\n             *\n             * @type { ?(string | Array<FormItem>) }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @atomicservice\n             * @since 11\n             */\n            data?: string | Array<FormItem>;\n            /**\n             * The path to save the downloaded file, the default is \"./\".\n             * Currently support:\n             * 1: relative path, like \"./xxx/yyy/zzz.html\", \"xxx/yyy/zzz.html\", under caller's cache folder.\n             * 2: uri path, like \"datashare://bundle/xxx/yyy/zzz.html\", the data provider must allow the caller's access.\n             *\n             * @type { ?string }\n             * @default ./\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * The path to save the downloaded file, the default is \"./\".\n             * Currently support:\n             * 1: relative path, like \"./xxx/yyy/zzz.html\", \"xxx/yyy/zzz.html\", under caller's cache folder.\n             * 2: uri path, like \"datashare://bundle/xxx/yyy/zzz.html\", the data provider must allow the caller's access.\n             *\n             * @type { ?string }\n             * @default ./\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @atomicservice\n             * @since 11\n             */\n            /**\n             * The path to save the downloaded file, the default is \"./\".\n             * Currently support:\n             * 1: relative path, like \"./xxx/yyy/zzz.html\", \"xxx/yyy/zzz.html\", under caller's cache folder.\n             * 2: internal protocol path, starting with \"internal://\", like \"internal://cache/path/to/file.txt\".\n             * 3: application storage path, only the base directory and its subdirectories are supported, like \"/data/storage/el1/base/path/to/file.txt\".\n             * 4: file protocol path with self bundle name, only the base directory and its subdirectories are supported, like \"file://com.example.test/data/storage/el2/base/file.txt\".\n             *\n             * @type { ?string }\n             * @default ./\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @atomicservice\n             * @since 12\n             */\n            saveas?: string;\n            /**\n             * Network used for the task.\n             * The default value is ANY (Wi-Fi or cellular).\n             *\n             * @type { ?Network }\n             * @default Network.ANY\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * Network used for the task.\n             * The default value is ANY (Wi-Fi or cellular).\n             *\n             * @type { ?Network }\n             * @default Network.ANY\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @atomicservice\n             * @since 11\n             */\n            network?: Network;\n            /**\n             * Allows work in metered network or not.\n             * The default is false.\n             *\n             * @type { ?boolean }\n             * @default false\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * Allows work in metered network or not.\n             * The default is false.\n             *\n             * @type { ?boolean }\n             * @default false\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @atomicservice\n             * @since 11\n             */\n            metered?: boolean;\n            /**\n             * Allows work in roaming network or not.\n             * The default is true.\n             *\n             * @type { ?boolean }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * Allows work in roaming network or not.\n             * The default is true.\n             *\n             * @type { ?boolean }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @atomicservice\n             * @since 11\n             */\n            roaming?: boolean;\n            /**\n             * Enable automatic retry or not for the background task.\n             * The frontend task is always fast-fail.\n             *\n             * @type { ?boolean }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * Enable automatic retry or not for the background task.\n             * The frontend task is always fast-fail.\n             *\n             * @type { ?boolean }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @atomicservice\n             * @since 11\n             */\n            retry?: boolean;\n            /**\n             * Allows redirect or not.\n             * The default is yes.\n             *\n             * @type { ?boolean }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * Allows redirect or not.\n             * The default is true.\n             *\n             * @type { ?boolean }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @atomicservice\n             * @since 11\n             */\n            redirect?: boolean;\n            /**\n             * The proxy url for the task.\n             * Only this format is supported: http://<domain or IP-address>:<port>\n             * Username and password are not supported.\n             *\n             * @type { ?string }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 12\n             */\n            proxy?: string;\n            /**\n             * The index of paths for a task.\n             * Usually used for a continuous job.\n             * The default is 0.\n             *\n             * @type { ?number }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * The index of paths for a task.\n             * Usually used for a continuous job.\n             * The default is 0.\n             *\n             * @type { ?number }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @atomicservice\n             * @since 11\n             */\n            index?: number;\n            /**\n             * The start point of a file.\n             * Usually used for a continuous job.\n             * It will set the \"Range\" header in download.\n             * It will start read at the point in upload.\n             * The default is 0.\n             *\n             * @type { ?number }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * The start point of a file.\n             * Usually used for a continuous job.\n             * It will set the \"Range\" header in download.\n             * It will start read at the point in upload.\n             * The default is 0.\n             *\n             * @type { ?number }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @atomicservice\n             * @since 11\n             */\n            begins?: number;\n            /**\n             * The end point of a file.\n             * Usually used for a continuous job.\n             * It will set The \"Range\" header in download.\n             * It will end read at the point in upload.\n             * The default is -1 indicating the end of the data for upload or download.\n             *\n             * @type { ?number }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * The end point of a file.\n             * Usually used for a continuous job.\n             * It will set The \"Range\" header in download.\n             * It will end read at the point in upload.\n             * The default is -1 indicating the end of the data for upload or download.\n             *\n             * @type { ?number }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @atomicservice\n             * @since 11\n             */\n            ends?: number;\n            /**\n             * The policy of the progress notification for background task.\n             * If false: only completed or failed notification, the default.\n             * If true, emits every progress, completed or failed notifications.\n             *\n             * @type { ?boolean }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * The policy of the progress notification for background task.\n             * If false: only completed or failed notification, the default.\n             * If true, emits every progress, completed or failed notifications.\n             *\n             * @type { ?boolean }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @atomicservice\n             * @since 11\n             */\n            gauge?: boolean;\n            /**\n             * Breaks when fail to fetch filesize before upload/download or not.\n             * Uses filesize for a precise gauge.\n             * The default is not, set size as -1 indicating the case.\n             *\n             * @type { ?boolean }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * Breaks when fail to fetch filesize before upload/download or not.\n             * Uses filesize for a precise gauge.\n             * The default is false, set size as -1 indicating the case.\n             *\n             * @type { ?boolean }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @atomicservice\n             * @since 11\n             */\n            precise?: boolean;\n            /**\n             * For in-application layer isolation.\n             * If given:\n             *   the minimum is 8 bytes.\n             *   the maximum is 2048 bytes.\n             * Creates a task with token, then must provide it during normal query.\n             * So saves the token carefully, it can not be retrieved by query.\n             * Or leave it empty.\n             *\n             * @type { ?string }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * For in-application layer isolation.\n             * If given:\n             *   the minimum is 8 bytes.\n             *   the maximum is 2048 bytes.\n             * Creates a task with token, then must provide it during normal query.\n             * So saves the token carefully, it can not be retrieved by query.\n             * Or leave it empty.\n             *\n             * @type { ?string }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @atomicservice\n             * @since 11\n             */\n            token?: string;\n            /**\n             * The priority of this task.\n             * Front-end tasks have higher priority than back-end tasks.\n             * In tasks of the same mode, the smaller the number, the higher the priority.\n             * The default is 0.\n             *\n             * @type { ?number }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 11\n             */\n            priority?: number;\n            /**\n             * The extras for the configuration.\n             * This parameter is left empty by default.\n             *\n             * @type { ?object }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * The extras for the configuration.\n             * This parameter is left empty by default.\n             *\n             * @type { ?object }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @atomicservice\n             * @since 11\n             */\n            extras?: object;\n            /**\n             * Use a single request to upload multiple files.\n             * If true, use the form format to merge multiple files into one request.\n             * If false, use independent requests to send each file.\n             * The default is false.\n             *\n             * @type { ?boolean }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 15\n             */\n            multipart?: boolean;\n            /**\n             * Customizes the notification of the backend task.\n             *\n             * @type { ?Notification }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 15\n             */\n            notification?: Notification;\n            /**\n             * Customizes the minimum speed of the task.\n             *\n             * @type { ?MinSpeed }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 20\n             */\n            minSpeed?: MinSpeed;\n            /**\n             * Customizes the timeout of the task.\n             *\n             * @type { ?Timeout }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 20\n             */\n            timeout?: Timeout;\n        }\n        /**\n         * Indicate the current state of the task.\n         *\n         * @enum { number } State\n         * @syscap SystemCapability.Request.FileTransferAgent\n         * @since 10\n         */\n        /**\n         * Indicate the current state of the task.\n         *\n         * @enum { number } State\n         * @syscap SystemCapability.Request.FileTransferAgent\n         * @crossplatform\n         * @atomicservice\n         * @since 11\n         */\n        enum State {\n            /**\n             * Indicates a task created by `new Task(Config)`.\n             *\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * Indicates a task created by `new Task(Config)`.\n             *\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @atomicservice\n             * @since 11\n             */\n            INITIALIZED = 0x00,\n            /**\n             * Indicates a task lack of resources or conditions to run or retry.\n             *\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * Indicates a task lack of resources or conditions to run or retry.\n             *\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @atomicservice\n             * @since 11\n             */\n            WAITING = 0x10,\n            /**\n             * Indicates a task in processing now.\n             *\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * Indicates a task in processing now.\n             *\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @atomicservice\n             * @since 11\n             */\n            RUNNING = 0x20,\n            /**\n             * Indicates a task failed once at least and in processing again now.\n             *\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * Indicates a task failed once at least and in processing again now.\n             *\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @atomicservice\n             * @since 11\n             */\n            RETRYING = 0x21,\n            /**\n             * Indicates a paused task which tends to be resumed for continuous work.\n             *\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * Indicates a paused task which tends to be resumed for continuous work.\n             *\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @atomicservice\n             * @since 11\n             */\n            PAUSED = 0x30,\n            /**\n             * Indicates a stopped task which must be started again.\n             *\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * Indicates a stopped task which must be started again.\n             *\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @atomicservice\n             * @since 11\n             */\n            STOPPED = 0x31,\n            /**\n             * Indicates a completed task which finish its data transfer.\n             *\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * Indicates a completed task which finish its data transfer.\n             *\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @atomicservice\n             * @since 11\n             */\n            COMPLETED = 0x40,\n            /**\n             * Indicates a failed task which interrupted by some error.\n             *\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * Indicates a failed task which interrupted by some error.\n             *\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @atomicservice\n             * @since 11\n             */\n            FAILED = 0x41,\n            /**\n             * Indicates a removed task which can not be processed again.\n             *\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * Indicates a removed task which can not be processed again.\n             *\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @atomicservice\n             * @since 11\n             */\n            REMOVED = 0x50\n        }\n        /**\n         * The progress data structure.\n         * Upload allows multiple files per upload task.\n         * Only one file in a download task.\n         * So using a unified data structure for progress.\n         * Generally:\n         * 1: sum(sizes) is total files size of the task.\n         * 2: float(processed)/sizes[counter] is the progress for the current processing file.\n         * 3: float(sum(sizes[:index])+processed)/sum(sizes) is the summary progress for a task.\n         * If fetch file size in failure, the size of the file in sizes will be set as -1.\n         *\n         * @typedef Progress\n         * @syscap SystemCapability.Request.FileTransferAgent\n         * @since 10\n         */\n        /**\n         * The progress data structure.\n         * Upload allows multiple files per upload task.\n         * Only one file in a download task.\n         * So using a unified data structure for progress.\n         * Generally:\n         * 1: sum(sizes) is total files size of the task.\n         * 2: float(processed)/sizes[counter] is the progress for the current processing file.\n         * 3: float(sum(sizes[:index])+processed)/sum(sizes) is the summary progress for a task.\n         * If fetch file size in failure, the size of the file in sizes will be set as -1.\n         *\n         * @typedef Progress\n         * @syscap SystemCapability.Request.FileTransferAgent\n         * @crossplatform\n         * @atomicservice\n         * @since 11\n         */\n        interface Progress {\n            /**\n             * The current state of the task.\n             *\n             * @type { State }\n             * @readonly\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * The current state of the task.\n             *\n             * @type { State }\n             * @readonly\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @atomicservice\n             * @since 11\n             */\n            readonly state: State;\n            /**\n             * The current processing file index in a task.\n             *\n             * @type { number }\n             * @readonly\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * The current processing file index in a task.\n             *\n             * @type { number }\n             * @readonly\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @atomicservice\n             * @since 11\n             */\n            readonly index: number;\n            /**\n             * The processed data size for the current file in a task.\n             *\n             * @type { number }\n             * @readonly\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * The processed data size for the current file in a task.\n             *\n             * @type { number }\n             * @readonly\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @atomicservice\n             * @since 11\n             */\n            readonly processed: number;\n            /**\n             * The sizes of files in a task, in bytes.\n             *\n             * @type { Array<number> }\n             * @readonly\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * The sizes of files in a task, in bytes.\n             *\n             * @type { Array<number> }\n             * @readonly\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @atomicservice\n             * @since 11\n             */\n            readonly sizes: Array<number>;\n            /**\n             * The extras for an interaction.\n             * Such as headers and body of response from server.\n             * But when the Content-Disposition header responded, the body will be into the uri of its attachment only, the body here is empty.\n             * {\"headers\": {\"key\": v}, \"body\": \"contents\"}.\n             *\n             * @type { ?object }\n             * @readonly\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * The extras for an interaction.\n             * Such as headers and body of response from server.\n             * But when the Content-Disposition header responded, the body will be into the uri of its attachment only, the body here is empty.\n             * {\"headers\": {\"key\": v}, \"body\": \"contents\"}.\n             * The \"body\" field is not supported in cross-platform scenarios.\n             *\n             * @type { ?object }\n             * @readonly\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @atomicservice\n             * @since 11\n             */\n            readonly extras?: object;\n        }\n        /**\n         * Indicates the reason for the failure.\n         *\n         * @enum { number }\n         * @syscap SystemCapability.Request.FileTransferAgent\n         * @since 10\n         */\n        /**\n         * Indicates the reason for the failure.\n         *\n         * @enum { number }\n         * @syscap SystemCapability.Request.FileTransferAgent\n         * @crossplatform\n         * @atomicservice\n         * @since 11\n         */\n        enum Faults {\n            /**\n             * Indicates others failure.\n             *\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * Indicates others failure.\n             *\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @atomicservice\n             * @since 11\n             */\n            OTHERS = 0xFF,\n            /**\n             * Indicates network disconnection.\n             *\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * Indicates network disconnection.\n             *\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @atomicservice\n             * @since 11\n             */\n            DISCONNECTED = 0x00,\n            /**\n             * Indicates task timeout.\n             *\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * Indicates task timeout.\n             *\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @atomicservice\n             * @since 11\n             */\n            TIMEOUT = 0x10,\n            /**\n             * Indicates protocol error, such as 5xx response from server.\n             *\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * Indicates protocol error, such as 5xx response from server.\n             *\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @atomicservice\n             * @since 11\n             */\n            PROTOCOL = 0x20,\n            /**\n             * Indicates parameter error, such as url format error.\n             *\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @atomicservice\n             * @since 12\n             */\n            PARAM = 0x30,\n            /**\n             * Indicates filesystem io error, such as open/seek/read/write/close.\n             *\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * Indicates filesystem io error, such as open/seek/read/write/close.\n             *\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @atomicservice\n             * @since 11\n             */\n            FSIO = 0x40,\n            /**\n             * Indicates DNS resolution error.\n             *\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @atomicservice\n             * @since 12\n             */\n            DNS = 0x50,\n            /**\n             * Indicates TCP connection error.\n             *\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @atomicservice\n             * @since 12\n             */\n            TCP = 0x60,\n            /**\n             * Indicates SSL connection error, such as a certificate error or certificate verification failure.\n             *\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @atomicservice\n             * @since 12\n             */\n            SSL = 0x70,\n            /**\n             * Indicates redirect error.\n             *\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @atomicservice\n             * @since 12\n             */\n            REDIRECT = 0x80,\n            /**\n             * Indicates the speed of the task is too slow.\n             *\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 20\n             */\n            LOW_SPEED = 0x90\n        }\n        /**\n         * The filter data structure.\n         * Used for search, given fields works as **LOGICAL AND**.\n         * Invalid value may cause a parameter error.\n         *\n         * @typedef Filter\n         * @syscap SystemCapability.Request.FileTransferAgent\n         * @since 10\n         */\n        /**\n         * The filter data structure.\n         * Used for search, given fields works as **LOGICAL AND**.\n         * Invalid value may cause a parameter error.\n         *\n         * @typedef Filter\n         * @syscap SystemCapability.Request.FileTransferAgent\n         * @crossplatform\n         * @since 11\n         */\n        interface Filter {\n            /**\n             * Specify the end Unix timestamp.\n             * The default is the moment of calling.\n             *\n             * @type { ?number }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * Specify the end Unix timestamp.\n             * The default is the moment of calling.\n             *\n             * @type { ?number }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @since 11\n             */\n            before?: number;\n            /**\n             * Specify the start Unix timestamp.\n             * The default is \"`before` - 24 hours\".\n             *\n             * @type { ?number }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * Specify the start Unix timestamp.\n             * The default is \"`before` - 24 hours\".\n             *\n             * @type { ?number }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @since 11\n             */\n            after?: number;\n            /**\n             * Specify the state of tasks.\n             * The default is any state.\n             *\n             * @type { ?State }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * Specify the state of tasks.\n             * The default is any state.\n             *\n             * @type { ?State }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @since 11\n             */\n            state?: State;\n            /**\n             * Specify the action of tasks, \"upload\" or \"download\", case insensitive.\n             * The default is upload and download.\n             *\n             * @type { ?Action }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * Specify the action of tasks, \"upload\" or \"download\", case insensitive.\n             * The default is upload and download.\n             *\n             * @type { ?Action }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @since 11\n             */\n            action?: Action;\n            /**\n             * Specify task's mode.\n             * The default is frontend and background.\n             *\n             * @type { ?Mode }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * Specify task's mode.\n             * The default is FOREGROUND and BACKGROUND.\n             *\n             * @type { ?Mode }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @since 11\n             */\n            mode?: Mode;\n        }\n        /**\n         * The task information data structure for query results.\n         * Provides common query and advanced query, visible range of fields is different.\n         *\n         * @typedef TaskInfo\n         * @syscap SystemCapability.Request.FileTransferAgent\n         * @since 10\n         */\n        /**\n         * The task information data structure for query results.\n         * Provides common query and advanced query, visible range of fields is different.\n         *\n         * @typedef TaskInfo\n         * @syscap SystemCapability.Request.FileTransferAgent\n         * @crossplatform\n         * @since 11\n         */\n        interface TaskInfo {\n            /**\n             * The path to save the downloaded file.\n             *\n             * @type { ?string }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * The path to save the downloaded file.\n             *\n             * @type { ?string }\n             * @readonly\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @since 11\n             */\n            readonly saveas?: string;\n            /**\n             * The url of a task.\n             * For `${ show }` and `${ touch }`.\n             * It is empty string in `${ query }`.\n             *\n             * @type { ?string }\n             * @readonly\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * The url of a task.\n             * For `${ show }` and `${ touch }`.\n             *\n             * @type { ?string }\n             * @readonly\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @since 11\n             */\n            readonly url?: string;\n            /**\n             * The arguments.\n             * For `${ show }` and `${ touch }`.\n             * It is empty string in `${ query }`.\n             *\n             * @type { ?(string | Array<FormItem>) }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * The arguments.\n             * For `${ show }` and `${ touch }`.\n             *\n             * @type { ?(string | Array<FormItem>) }\n             * @readonly\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @since 11\n             */\n            readonly data?: string | Array<FormItem>;\n            /**\n             * The task id.\n             *\n             * @type { string }\n             * @readonly\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * The task id.\n             *\n             * @type { string }\n             * @readonly\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @since 11\n             */\n            readonly tid: string;\n            /**\n             * The task title.\n             *\n             * @type { string }\n             * @readonly\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * The task title.\n             *\n             * @type { string }\n             * @readonly\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @since 11\n             */\n            readonly title: string;\n            /**\n             * The task details.\n             *\n             * @type { string }\n             * @readonly\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * The task details.\n             *\n             * @type { string }\n             * @readonly\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @since 11\n             */\n            readonly description: string;\n            /**\n             * The task action.\n             *\n             * @type { Action }\n             * @readonly\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * The task action.\n             *\n             * @type { Action }\n             * @readonly\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @since 11\n             */\n            readonly action: Action;\n            /**\n             * Specify task mode.\n             * The default is frontend and background.\n             *\n             * @type { Mode }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * Specify task mode.\n             * The default is frontend.\n             *\n             * @type { Mode }\n             * @readonly\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @since 11\n             */\n            readonly mode: Mode;\n            /**\n             * The priority of this task.\n             * Front-end tasks have higher priority than back-end tasks.\n             * In tasks of the same mode, the smaller the number, the higher the priority.\n             * The default is 0.\n             *\n             * @type { number }\n             * @readonly\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 11\n             */\n            readonly priority: number;\n            /**\n             * The MIME type in the configuration of the task.\n             *\n             * @type { string }\n             * @readonly\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * The MIME type in the configuration of the task.\n             *\n             * @type { string }\n             * @readonly\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @since 11\n             */\n            readonly mimeType: string;\n            /**\n             * An instance of `Progress` for a task.\n             *\n             * @type { Progress }\n             * @readonly\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * An instance of `Progress` for a task.\n             *\n             * @type { Progress }\n             * @readonly\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @since 11\n             */\n            readonly progress: Progress;\n            /**\n             * The progress notification policy of a background task.\n             *\n             * @type { boolean }\n             * @readonly\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            readonly gauge: boolean;\n            /**\n             * The creating date and time of a task in Unix timestamp.\n             * It is generated by system of current device.\n             *\n             * @type { number }\n             * @readonly\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * The creating date and time of a task in Unix timestamp.\n             * It is generated by system of current device.\n             *\n             * @type { number }\n             * @readonly\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @since 11\n             */\n            readonly ctime: number;\n            /**\n             * The modified date and time of a task in Unix timestamp.\n             * It is generated by system of current device.\n             *\n             * @type { number }\n             * @readonly\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * The modified date and time of a task in Unix timestamp.\n             * It is generated by system of current device.\n             *\n             * @type { number }\n             * @readonly\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @since 11\n             */\n            readonly mtime: number;\n            /**\n             * The retry switch of a task.\n             * Just for background, frontend always disabled.\n             *\n             * @type { boolean }\n             * @readonly\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            readonly retry: boolean;\n            /**\n             * The tried times of a task.\n             *\n             * @type { number }\n             * @readonly\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            readonly tries: number;\n            /**\n             * The faults case of a task.\n             *\n             * @type { Faults }\n             * @readonly\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * The faults case of a task.\n             *\n             * @type { Faults }\n             * @readonly\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @since 11\n             */\n            readonly faults: Faults;\n            /**\n             * The reason of a waiting/failed/stopped/paused task.\n             *\n             * @type { string }\n             * @readonly\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * The reason of a waiting/failed/stopped/paused task.\n             *\n             * @type { string }\n             * @readonly\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @since 11\n             */\n            readonly reason: string;\n            /**\n             * The extras of a task.\n             * For background, the last response from server.\n             * For frontend, nothing now.\n             *\n             * @type { ?object }\n             * @readonly\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * The extras of a task.\n             * For frontend, nothing now.\n             *\n             * @type { ?object }\n             * @readonly\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @since 11\n             */\n            readonly extras?: object;\n        }\n        /**\n         * The HTTP response.\n         * Describes the data structure of the task response header.\n         *\n         * @interface HttpResponse\n         * @syscap SystemCapability.Request.FileTransferAgent\n         * @atomicservice\n         * @since 12\n         */\n        interface HttpResponse {\n            /**\n             * The version of the HTTP response.\n             *\n             * @type { string }\n             * @readonly\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @atomicservice\n             * @since 12\n             */\n            readonly version: string;\n            /**\n             * The status code of the HTTP response.\n             *\n             * @type { number }\n             * @readonly\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @atomicservice\n             * @since 12\n             */\n            readonly statusCode: number;\n            /**\n             * The reason of the HTTP response.\n             *\n             * @type { string }\n             * @readonly\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @atomicservice\n             * @since 12\n             */\n            readonly reason: string;\n            /**\n             * The headers of the HTTP response.\n             *\n             * @type { Map<string, Array<string>> }\n             * @readonly\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @atomicservice\n             * @since 12\n             */\n            readonly headers: Map<string, Array<string>>;\n        }\n        /**\n         * Reason for task waiting.\n         *\n         * @enum { number }\n         * @syscap SystemCapability.Request.FileTransferAgent\n         * @since 20\n         */\n        enum WaitingReason {\n            /**\n             * Indicates the task is waiting for running queue to be free.\n             *\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 20\n             */\n            TASK_QUEUE_FULL = 0x00,\n            /**\n             * Indicates the task is waiting for network to recover.\n             *\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 20\n             */\n            NETWORK_NOT_MATCH = 0x01,\n            /**\n             * Indicates the task is waiting for app to return to the foreground.\n             *\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 20\n             */\n            APP_BACKGROUND = 0x02,\n            /**\n             * Indicates the task is waiting for user to become activated.\n             *\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 20\n             */\n            USER_INACTIVATED = 0x03\n        }\n        /**\n         * The task entry.\n         * New task' status is \"initialized\" and enqueue.\n         * Can `start` a initialized task.\n         * Can `pause` a waiting/running/retrying background task.\n         * Can `resume` a paused background task.\n         * Can `stop` a running/waiting/retrying task and dequeue it.\n         *\n         * @typedef Task\n         * @syscap SystemCapability.Request.FileTransferAgent\n         * @since 10\n         */\n        /**\n         * The task entry.\n         * New task' status is \"initialized\" and enqueue.\n         * Can `start` a initialized task.\n         * Can `pause` a waiting/running/retrying background task.\n         * Can `resume` a paused background task.\n         * Can `stop` a running/waiting/retrying task and dequeue it.\n         *\n         * @typedef Task\n         * @syscap SystemCapability.Request.FileTransferAgent\n         * @crossplatform\n         * @atomicservice\n         * @since 11\n         */\n        interface Task {\n            /**\n             * The task id, unique on system.\n             * Generated automatically by system.\n             *\n             * @type { string }\n             * @readonly\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * The task id, unique on system.\n             * Generated automatically by system.\n             *\n             * @type { string }\n             * @readonly\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @atomicservice\n             * @since 11\n             */\n            readonly tid: string;\n            /**\n             * The configurations for the task.\n             *\n             * @type { Config }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * The configurations for the task.\n             *\n             * @type { Config }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @atomicservice\n             * @since 11\n             */\n            config: Config;\n            /**\n             * Enable the specified callback for a frontend task.\n             * Subscribes to task progress changes.\n             *\n             * @param { 'progress' } event event types.\n             * @param { function } callback callback function with a `Progress` argument.\n             * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Missing mandatory parameters.\n             * <br>2. Incorrect parameter type. 3. Parameter verification failed.\n             * @throws { BusinessError } 21900005 - task mode error.\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * Enables the specified callback.\n             * Subscribes to task progress changes.\n             *\n             * @param { 'progress' } event - event types.\n             * @param { function } callback - callback function with a `Progress` argument.\n             * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Missing mandatory parameters.\n             * <br>2. Incorrect parameter type. 3. Parameter verification failed.\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @atomicservice\n             * @since 11\n             */\n            on(event: 'progress', callback: (progress: Progress) => void): void;\n            /**\n             * Disable the specified callback for a frontend task.\n             * Unsubscribes from task progress events.\n             *\n             * @param { 'progress' } event event types.\n             * @param { function } callback callback function with a `Progress` argument.\n             * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Missing mandatory parameters.\n             * <br>2. Incorrect parameter type. 3. Parameter verification failed.\n             * @throws { BusinessError } 21900005 - task mode error.\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * Disables the specified callback.\n             * Unsubscribes from task progress events.\n             *\n             * @param { 'progress' } event - event types.\n             * @param { function } callback - callback function with a `Progress` argument.\n             * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Missing mandatory parameters.\n             * <br>2. Incorrect parameter type. 3. Parameter verification failed.\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @atomicservice\n             * @since 11\n             */\n            off(event: 'progress', callback?: (progress: Progress) => void): void;\n            /**\n             * Enable the specified callback for a frontend task.\n             * Subscribes to task completion events.\n             *\n             * @param { 'completed' } event event types.\n             * @param { function } callback callback function with a `Progress` argument.\n             * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Missing mandatory parameters.\n             * <br>2. Incorrect parameter type. 3. Parameter verification failed.\n             * @throws { BusinessError } 21900005 - Operation with wrong task mode.\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * Enables the specified callback.\n             * Subscribes to task completion events.\n             *\n             * @param { 'completed' } event - event types.\n             * @param { function } callback - callback function with a `Progress` argument.\n             * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Missing mandatory parameters.\n             * <br>2. Incorrect parameter type. 3. Parameter verification failed.\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @atomicservice\n             * @since 11\n             */\n            on(event: 'completed', callback: (progress: Progress) => void): void;\n            /**\n             * Disable the specified callback for a frontend task.\n             * Unsubscribes from task completion events.\n             *\n             * @param { 'completed' } event event types.\n             * @param { function } callback callback function with a `Progress` argument.\n             * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Missing mandatory parameters.\n             * <br>2. Incorrect parameter type. 3. Parameter verification failed.\n             * @throws { BusinessError } 21900005 - Operation with wrong task mode.\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * Disables the specified callback.\n             * Unsubscribes from task completion events.\n             *\n             * @param { 'completed' } event - event types.\n             * @param { function } callback - callback function with a `Progress` argument.\n             * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Missing mandatory parameters.\n             * <br>2. Incorrect parameter type. 3. Parameter verification failed.\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @atomicservice\n             * @since 11\n             */\n            off(event: 'completed', callback?: (progress: Progress) => void): void;\n            /**\n             * Enable the specified callback for a frontend task.\n             * Subscribes to task failure events.\n             *\n             * @param { 'failed' } event event types.\n             * @param { function } callback callback function with a `Progress` argument.\n             * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Missing mandatory parameters.\n             * <br>2. Incorrect parameter type. 3. Parameter verification failed.\n             * @throws { BusinessError } 21900005 - Operation with wrong task mode.\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * Enables the specified callback.\n             * Subscribes to task failure events.\n             *\n             * @param { 'failed' } event - event types.\n             * @param { function } callback - callback function with a `Progress` argument.\n             * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Missing mandatory parameters.\n             * <br>2. Incorrect parameter type. 3. Parameter verification failed.\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @atomicservice\n             * @since 11\n             */\n            on(event: 'failed', callback: (progress: Progress) => void): void;\n            /**\n             * Disable the specified callback for a frontend task.\n             * Unsubscribes from task failure events.\n             *\n             * @param { 'failed' } event event types.\n             * @param { function } callback callback function with a `Progress` argument.\n             * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Missing mandatory parameters.\n             * <br>2. Incorrect parameter type. 3. Parameter verification failed.\n             * @throws { BusinessError } 21900005 - Operation with wrong task mode.\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * Disables the specified callback.\n             * Unsubscribes from task failure events.\n             *\n             * @param { 'failed' } event - event types.\n             * @param { function } callback - callback function with a `Progress` argument.\n             * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Missing mandatory parameters.\n             * <br>2. Incorrect parameter type. 3. Parameter verification failed.\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @atomicservice\n             * @since 11\n             */\n            off(event: 'failed', callback?: (progress: Progress) => void): void;\n            /**\n             * Enables the specified callback.\n             * Subscribes to task pause events.\n             *\n             * @param { 'pause' } event - event types.\n             * @param { function } callback - callback function with a `Progress` argument.\n             * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Missing mandatory parameters.\n             * <br>2. Incorrect parameter type. 3. Parameter verification failed.\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 11\n             */\n            on(event: 'pause', callback: (progress: Progress) => void): void;\n            /**\n             * Disables the specified callback.\n             * Unsubscribes from the foreground task pause event.\n             *\n             * @param { 'pause' } event - event types.\n             * @param { function } callback - callback function with a `Progress` argument.\n             * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Missing mandatory parameters.\n             * <br>2. Incorrect parameter type. 3. Parameter verification failed.\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 11\n             */\n            off(event: 'pause', callback?: (progress: Progress) => void): void;\n            /**\n             * Enables the specified callback.\n             * Subscribes to task resume events.\n             *\n             * @param { 'resume' } event - event types.\n             * @param { function } callback - callback function with a `Progress` argument.\n             * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Missing mandatory parameters.\n             * <br>2. Incorrect parameter type. 3. Parameter verification failed.\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 11\n             */\n            on(event: 'resume', callback: (progress: Progress) => void): void;\n            /**\n             * Disables the specified callback.\n             * Unsubscribes from the foreground task resume event.\n             *\n             * @param { 'resume' } event - event types.\n             * @param { function } callback - callback function with a `Progress` argument.\n             * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Missing mandatory parameters.\n             * <br>2. Incorrect parameter type. 3. Parameter verification failed.\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 11\n             */\n            off(event: 'resume', callback?: (progress: Progress) => void): void;\n            /**\n             * Enables the specified callback.\n             * Subscribes to task removal events.\n             *\n             * @param { 'remove' } event - event types.\n             * @param { function } callback - callback function with a `Progress` argument.\n             * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Missing mandatory parameters.\n             * <br>2. Incorrect parameter type. 3. Parameter verification failed.\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 11\n             */\n            on(event: 'remove', callback: (progress: Progress) => void): void;\n            /**\n             * Disables the specified callback.\n             * Unsubscribes from the task removal event.\n             *\n             * @param { 'remove' } event - event types.\n             * @param { function } callback - callback function with a `Progress` argument.\n             * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Missing mandatory parameters.\n             * <br>2. Incorrect parameter type. 3. Parameter verification failed.\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 11\n             */\n            off(event: 'remove', callback?: (progress: Progress) => void): void;\n            /**\n             * Enables the response callback.\n             * Subscribes to task response headers.\n             *\n             * @param { 'response' } event - event types.\n             * @param { Callback<HttpResponse> } callback - callback function with an `HttpResponse` argument.\n             * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Missing mandatory parameters.\n             * <br>2. Incorrect parameter type. 3. Parameter verification failed.\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @atomicservice\n             * @since 12\n             */\n            on(event: 'response', callback: Callback<HttpResponse>): void;\n            /**\n             * Disables the response callback.\n             * Unsubscribes from task response headers.\n             *\n             * @param { 'response' } event - event types.\n             * @param { Callback<HttpResponse> } callback - callback function with an `HttpResponse` argument.\n             * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Missing mandatory parameters.\n             * <br>2. Incorrect parameter type. 3. Parameter verification failed.\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @atomicservice\n             * @since 12\n             */\n            off(event: 'response', callback?: Callback<HttpResponse>): void;\n            /**\n             * Enables the 'faultOccur' callback.\n             * This callback is triggered when the task failed.\n             * The returned `Faults` will contain the reason why the task failed.\n             *\n             * @param { 'faultOccur' } event - event types.\n             * @param { Callback<Faults> } callback - callback function with a `Faults` argument.\n             * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Missing mandatory parameters.\n             * <br>2. Incorrect parameter type. 3. Parameter verification failed.\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 20\n             */\n            on(event: 'faultOccur', callback: Callback<Faults>): void;\n            /**\n             * Disables the 'faultOccur' callback.\n             *\n             * @param { 'faultOccur' } event - event types.\n             * @param { Callback<Faults> } callback - callback function with a `Faults` argument.\n             * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Missing mandatory parameters.\n             * <br>2. Incorrect parameter type. 3. Parameter verification failed.\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 20\n             */\n            off(event: 'faultOccur', callback?: Callback<Faults>): void;\n            /**\n             * Enables the wait callback.\n             * This callback is triggered when the task changes from other states to the waiting state.\n             * The returned `WaitingReason` will contain the reason why the task enters waiting state.\n             *\n             * @param { 'wait' } event - event types.\n             * @param { Callback<WaitingReason> } callback - callback function with an `WaitingReason` argument.\n             * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Missing mandatory parameters.\n             * <br>2. Incorrect parameter type. 3. Parameter verification failed.\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 20\n             */\n            on(event: 'wait', callback: Callback<WaitingReason>): void;\n            /**\n             * Disables the wait callback.\n             *\n             * @param { 'wait' } event - event types.\n             * @param { Callback<WaitingReason> } callback - callback function with an `WaitingReason` argument.\n             * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Missing mandatory parameters.\n             * <br>2. Incorrect parameter type. 3. Parameter verification failed.\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 20\n             */\n            off(event: 'wait', callback?: Callback<WaitingReason>): void;\n            /**\n             * Starts the task.\n             *\n             * @permission ohos.permission.INTERNET\n             * @param { AsyncCallback<void> } callback callback function with a boolean argument indicating the calling result.\n             * @throws { BusinessError } 201 - Permission denied.\n             * @throws { BusinessError } 13400003 - Task service ability error.\n             * @throws { BusinessError } 21900007 - Operation with wrong task state.\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * Starts the task.\n             *\n             * @permission ohos.permission.INTERNET\n             * @param { AsyncCallback<void> } callback callback function with a boolean argument indicating the calling result.\n             * @throws { BusinessError } 201 - Permission denied.\n             * @throws { BusinessError } 13400003 - Task service ability error.\n             * @throws { BusinessError } 21900007 - Operation with wrong task state.\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @atomicservice\n             * @since 11\n             */\n            /**\n             * Starts the task. The following tasks can be started:\n             * 1. Tasks just created.\n             * 2. Download tasks that are stopped or become FAILED.\n             *\n             * @permission ohos.permission.INTERNET\n             * @param { AsyncCallback<void> } callback callback function with a boolean argument indicating the calling result.\n             * @throws { BusinessError } 201 - Permission denied.\n             * @throws { BusinessError } 13400003 - Task service ability error.\n             * @throws { BusinessError } 21900007 - Operation with wrong task state.\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @atomicservice\n             * @since 12\n             */\n            start(callback: AsyncCallback<void>): void;\n            /**\n             * Starts the task.\n             *\n             * @permission ohos.permission.INTERNET\n             * @returns { Promise<void> } the promise returned by the function.\n             * @throws { BusinessError } 201 - Permission denied.\n             * @throws { BusinessError } 13400003 - Task service ability error.\n             * @throws { BusinessError } 21900007 - Operation with wrong task state.\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * Starts the task.\n             *\n             * @permission ohos.permission.INTERNET\n             * @returns { Promise<void> } the promise returned by the function.\n             * @throws { BusinessError } 201 - Permission denied.\n             * @throws { BusinessError } 13400003 - Task service ability error.\n             * @throws { BusinessError } 21900007 - Operation with wrong task state.\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @atomicservice\n             * @since 11\n             */\n            /**\n             * Starts the task. The following tasks can be started:\n             * 1. Tasks just created.\n             * 2. Download tasks that are stopped or become FAILED.\n             *\n             * @permission ohos.permission.INTERNET\n             * @returns { Promise<void> } the promise returned by the function.\n             * @throws { BusinessError } 201 - Permission denied.\n             * @throws { BusinessError } 13400003 - Task service ability error.\n             * @throws { BusinessError } 21900007 - Operation with wrong task state.\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @atomicservice\n             * @since 12\n             */\n            start(): Promise<void>;\n            /**\n             * Pauses the background task.\n             *\n             * @param { AsyncCallback<void> } callback callback function with a boolean argument indicating the calling result.\n             * @throws { BusinessError } 13400003 - Task service ability error.\n             * @throws { BusinessError } 21900005 - Operation with wrong task mode.\n             * @throws { BusinessError } 21900007 - Operation with wrong task state.\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * Pauses a task that is waiting, running, or retrying.\n             *\n             * @param { AsyncCallback<void> } callback - callback function with a boolean argument indicating the calling result.\n             * @throws { BusinessError } 13400003 - Task service ability error.\n             * @throws { BusinessError } 21900007 - Operation with wrong task state.\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 11\n             */\n            pause(callback: AsyncCallback<void>): void;\n            /**\n             * Pauses the background task.\n             *\n             * @returns { Promise<void> } the promise returned by the function.\n             * @throws { BusinessError } 13400003 - Task service ability error.\n             * @throws { BusinessError } 21900005 - Operation with wrong task mode.\n             * @throws { BusinessError } 21900007 - Operation with wrong task state.\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * Pauses a task that is waiting, running, or retrying.\n             *\n             * @returns { Promise<void> } the promise returned by the function.\n             * @throws { BusinessError } 13400003 - Task service ability error.\n             * @throws { BusinessError } 21900007 - Operation with wrong task state.\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 11\n             */\n            pause(): Promise<void>;\n            /**\n             * Resumes the background task.\n             *\n             * @permission ohos.permission.INTERNET\n             * @param { AsyncCallback<void> } callback callback function with a boolean argument indicating the calling result.\n             * @throws { BusinessError } 201 - Permission denied.\n             * @throws { BusinessError } 13400003 - Task service ability error.\n             * @throws { BusinessError } 21900005 - Operation with wrong task mode.\n             * @throws { BusinessError } 21900007 - Operation with wrong task state.\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * Resumes a paused task.\n             *\n             * @permission ohos.permission.INTERNET\n             * @param { AsyncCallback<void> } callback - callback function with a boolean argument indicating the calling result.\n             * @throws { BusinessError } 201 - Permission denied.\n             * @throws { BusinessError } 13400003 - Task service ability error.\n             * @throws { BusinessError } 21900007 - Operation with wrong task state.\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 11\n             */\n            resume(callback: AsyncCallback<void>): void;\n            /**\n             * Resumes the background task.\n             *\n             * @permission ohos.permission.INTERNET\n             * @returns { Promise<void> } the promise returned by the function.\n             * @throws { BusinessError } 201 - Permission denied.\n             * @throws { BusinessError } 13400003 - Task service ability error.\n             * @throws { BusinessError } 21900005 - Operation with wrong task mode.\n             * @throws { BusinessError } 21900007 - Operation with wrong task state.\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * Resumes a paused task.\n             *\n             * @permission ohos.permission.INTERNET\n             * @returns { Promise<void> } the promise returned by the function.\n             * @throws { BusinessError } 201 - Permission denied.\n             * @throws { BusinessError } 13400003 - Task service ability error.\n             * @throws { BusinessError } 21900007 - Operation with wrong task state.\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 11\n             */\n            resume(): Promise<void>;\n            /**\n             * Stop a running, waiting, or retrying task.\n             *\n             * @param { AsyncCallback<void> } callback callback function with a boolean argument indicating the calling result.\n             * @throws { BusinessError } 13400003 - Task service ability error.\n             * @throws { BusinessError } 21900007 - Operation with wrong task state.\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * Stop a running, waiting, or retrying task.\n             *\n             * @param { AsyncCallback<void> } callback callback function with a boolean argument indicating the calling result.\n             * @throws { BusinessError } 13400003 - Task service ability error.\n             * @throws { BusinessError } 21900007 - Operation with wrong task state.\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @atomicservice\n             * @since 11\n             */\n            stop(callback: AsyncCallback<void>): void;\n            /**\n             * Stop a running, waiting, or retrying task.\n             *\n             * @returns { Promise<void> } the promise returned by the function.\n             * @throws { BusinessError } 13400003 - Task service ability error.\n             * @throws { BusinessError } 21900007 - Operation with wrong task state.\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 10\n             */\n            /**\n             * Stop a running, waiting, or retrying task.\n             *\n             * @returns { Promise<void> } the promise returned by the function.\n             * @throws { BusinessError } 13400003 - Task service ability error.\n             * @throws { BusinessError } 21900007 - Operation with wrong task state.\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @crossplatform\n             * @atomicservice\n             * @since 11\n             */\n            stop(): Promise<void>;\n            /**\n             * Sets the maximum transfer speed of the task.\n             * The minimum value of the speed limit is 16,384 bytes per second(16 KB/s).\n             *\n             * @param { number } speed - the maximum transfer speed of the task, in bytes per second.\n             * @returns { Promise<void> } the promise returned by the function.\n             * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Missing mandatory parameters.\n             * <br>2. Incorrect parameter type. 3. Parameter verification failed.\n             * @throws { BusinessError } 13400003 - Task service ability error.\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 18\n             */\n            setMaxSpeed(speed: number): Promise<void>;\n        }\n        /**\n         * Creates a task for upload or download and enqueue it.\n         * Only foreground application can create the frontend task.\n         * It can deal only one frontend task at a time.\n         * A in processing frontend task will be forced to stop when its application had switched to background.\n         * A new frontend task will interrupt a existed in processing frontend task.\n         * The background task is highly recommended.\n         *\n         * @permission ohos.permission.INTERNET\n         * @param { BaseContext } context context of the caller.\n         * @param { Config } config configurations for a task.\n         * @param { AsyncCallback<Task> } callback indicate the callback function to receive Task.\n         * @throws { BusinessError } 201 - Permission denied.\n         * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Missing mandatory parameters.\n         * <br>2. Incorrect parameter type. 3. Parameter verification failed.\n         * @throws { BusinessError } 13400001 - Invalid file or file system error.\n         * @throws { BusinessError } 13400003 - Task service ability error.\n         * @throws { BusinessError } 21900004 - the application task queue is full.\n         * @throws { BusinessError } 21900005 - Operation with wrong task mode.\n         * @syscap SystemCapability.Request.FileTransferAgent\n         * @since 10\n         */\n        /**\n         * Creates a task for upload or download and enqueue it.\n         * When an application enters the background, the frontend tasks associated\n         * with it will gradually be paused until the application returns to the foreground.\n         *\n         * @permission ohos.permission.INTERNET\n         * @param { BaseContext } context context of the caller.\n         * @param { Config } config configurations for a task.\n         * @param { AsyncCallback<Task> } callback indicate the callback function to receive Task.\n         * @throws { BusinessError } 201 - Permission denied.\n         * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Missing mandatory parameters.\n         * <br>2. Incorrect parameter type. 3. Parameter verification failed.\n         * @throws { BusinessError } 13400001 - Invalid file or file system error.\n         * @throws { BusinessError } 13400003 - Task service ability error.\n         * @throws { BusinessError } 21900004 - The application task queue is full.\n         * @throws { BusinessError } 21900005 - Operation with wrong task mode.\n         * @syscap SystemCapability.Request.FileTransferAgent\n         * @crossplatform\n         * @atomicservice\n         * @since 11\n         */\n        function create(context: BaseContext, config: Config, callback: AsyncCallback<Task>): void;\n        /**\n         * Creates a task for upload or download and enqueue it.\n         * Only foreground application can create the frontend task.\n         * It can deal only one frontend task at a time.\n         * A in processing frontend task will be forced to stop when its application had switched to background.\n         * A new frontend task will interrupt a existed in processing frontend task.\n         * The background task is highly recommended.\n         *\n         * @permission ohos.permission.INTERNET\n         * @param { BaseContext } context context of the caller.\n         * @param { Config } config configurations for a task.\n         * @returns { Promise<Task> } the promise returned by the function.\n         * @throws { BusinessError } 201 - Permission denied.\n         * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Missing mandatory parameters.\n         * <br>2. Incorrect parameter type. 3. Parameter verification failed.\n         * @throws { BusinessError } 13400001 - Invalid file or file system error.\n         * @throws { BusinessError } 13400003 - Task service ability error.\n         * @throws { BusinessError } 21900004 - the application task queue is full.\n         * @throws { BusinessError } 21900005 - Operation with wrong task mode.\n         * @syscap SystemCapability.Request.FileTransferAgent\n         * @since 10\n         */\n        /**\n         * Creates a task for upload or download and enqueue it.\n         * When an application enters the background, the frontend tasks associated.\n         * with it will gradually be paused until the application returns to the foreground.\n         *\n         * @permission ohos.permission.INTERNET\n         * @param { BaseContext } context context of the caller.\n         * @param { Config } config configurations for a task.\n         * @returns { Promise<Task> } the promise returned by the function.\n         * @throws { BusinessError } 201 - Permission denied.\n         * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Missing mandatory parameters.\n         * <br>2. Incorrect parameter type. 3. Parameter verification failed.\n         * @throws { BusinessError } 13400001 - Invalid file or file system error.\n         * @throws { BusinessError } 13400003 - Task service ability error.\n         * @throws { BusinessError } 21900004 - The application task queue is full.\n         * @throws { BusinessError } 21900005 - Operation with wrong task mode.\n         * @syscap SystemCapability.Request.FileTransferAgent\n         * @crossplatform\n         * @atomicservice\n         * @since 11\n         */\n        function create(context: BaseContext, config: Config): Promise<Task>;\n        /**\n         * Gets the task with the specified id.\n         * Obtains task information based on the task ID.\n         *\n         * @param { BaseContext } context - context of the caller.\n         * @param { string } id - the id of the task.\n         * @param { string } token - the token of the task, length between 8 and 2048 bytes.\n         * @returns { Promise<Task> } the promise returned by the function.\n         * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Missing mandatory parameters.\n         * <br>2. Incorrect parameter type. 3. Parameter verification failed.\n         * @throws { BusinessError } 13400003 - Task service ability error.\n         * @throws { BusinessError } 21900006 - Task removed or not found.\n         * @syscap SystemCapability.Request.FileTransferAgent\n         * @since 11\n         */\n        function getTask(context: BaseContext, id: string, token?: string): Promise<Task>;\n        /**\n         * Removes specified task belongs to the caller.\n         * The task will be forced to stop if in processing.\n         *\n         * @param { string } id the task id.\n         * @param { AsyncCallback<void> } callback callback function with a boolean argument indicating success or not.\n         * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Missing mandatory parameters.\n         * <br>2. Incorrect parameter type.\n         * @throws { BusinessError } 13400003 - Task service ability error.\n         * @throws { BusinessError } 21900006 - Task removed or not found.\n         * @syscap SystemCapability.Request.FileTransferAgent\n         * @since 10\n         */\n        /**\n         * Removes specified task belongs to the caller.\n         * The task will be forced to stop if in processing.\n         *\n         * @param { string } id the task id.\n         * @param { AsyncCallback<void> } callback callback function with a boolean argument indicating success or not.\n         * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Missing mandatory parameters.\n         * <br>2. Incorrect parameter type.\n         * @throws { BusinessError } 13400003 - Task service ability error.\n         * @throws { BusinessError } 21900006 - Task removed or not found.\n         * @syscap SystemCapability.Request.FileTransferAgent\n         * @crossplatform\n         * @atomicservice\n         * @since 11\n         */\n        function remove(id: string, callback: AsyncCallback<void>): void;\n        /**\n         * Removes specified task belongs to the caller.\n         * The task will be forced to stop if in processing.\n         *\n         * @param { string } id the task id.\n         * @returns { Promise<void> } the promise returned by the function.\n         * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Missing mandatory parameters.\n         * <br>2. Incorrect parameter type.\n         * @throws { BusinessError } 13400003 - Task service ability error.\n         * @throws { BusinessError } 21900006 - Task removed or not found.\n         * @syscap SystemCapability.Request.FileTransferAgent\n         * @since 10\n         */\n        /**\n         * Removes specified task belongs to the caller.\n         * The task will be forced to stop if in processing.\n         *\n         * @param { string } id the task id.\n         * @returns { Promise<void> } the promise returned by the function.\n         * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Missing mandatory parameters.\n         * <br>2. Incorrect parameter type.\n         * @throws { BusinessError } 13400003 - Task service ability error.\n         * @throws { BusinessError } 21900006 - Task removed or not found.\n         * @syscap SystemCapability.Request.FileTransferAgent\n         * @crossplatform\n         * @atomicservice\n         * @since 11\n         */\n        function remove(id: string): Promise<void>;\n        /**\n         * Shows specified task details belongs to the caller.\n         * Queries a task details based on the task ID.\n         *\n         * @param { string } id the task id.\n         * @param { AsyncCallback<TaskInfo> } callback callback function with a `TaskInfo` argument for informations of the current task.\n         * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Missing mandatory parameters.\n         * <br>2. Incorrect parameter type.\n         * @throws { BusinessError } 13400003 - Task service ability error.\n         * @throws { BusinessError } 21900006 - Task removed or not found.\n         * @syscap SystemCapability.Request.FileTransferAgent\n         * @since 10\n         */\n        /**\n         * Shows specified task details belongs to the caller.\n         * Queries a task details based on the task ID.\n         *\n         * @param { string } id the task id.\n         * @param { AsyncCallback<TaskInfo> } callback callback function with a `TaskInfo` argument for informations of the current task.\n         * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Missing mandatory parameters.\n         * <br>2. Incorrect parameter type.\n         * @throws { BusinessError } 13400003 - Task service ability error.\n         * @throws { BusinessError } 21900006 - Task removed or not found.\n         * @syscap SystemCapability.Request.FileTransferAgent\n         * @crossplatform\n         * @since 11\n         */\n        function show(id: string, callback: AsyncCallback<TaskInfo>): void;\n        /**\n         * Shows specified task details belongs to the caller.\n         * Queries a task details based on the task ID.\n         *\n         * @param { string } id the task id.\n         * @returns { Promise<TaskInfo> } the promise returned by the function.\n         * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Missing mandatory parameters.\n         * <br>2. Incorrect parameter type.\n         * @throws { BusinessError } 13400003 - Task service ability error.\n         * @throws { BusinessError } 21900006 - Task removed or not found.\n         * @syscap SystemCapability.Request.FileTransferAgent\n         * @since 10\n         */\n        /**\n         * Shows specified task details belongs to the caller.\n         * Queries a task details based on the task ID.\n         *\n         * @param { string } id the task id.\n         * @returns { Promise<TaskInfo> } the promise returned by the function.\n         * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Missing mandatory parameters.\n         * <br>2. Incorrect parameter type.\n         * @throws { BusinessError } 13400003 - Task service ability error.\n         * @throws { BusinessError } 21900006 - Task removed or not found.\n         * @syscap SystemCapability.Request.FileTransferAgent\n         * @crossplatform\n         * @since 11\n         */\n        function show(id: string): Promise<TaskInfo>;\n        /**\n         * Touches specified task with token.\n         * Queries the task details based on the task ID and token.\n         *\n         * @param { string } id the task id.\n         * @param { string } token the in-application isolation key.\n         * @param { AsyncCallback<TaskInfo> } callback callback function with a `TaskInfo` argument for informations of the current task.\n         * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Missing mandatory parameters.\n         * <br>2. Incorrect parameter type. 3. Parameter verification failed.\n         * @throws { BusinessError } 13400003 - Task service ability error.\n         * @throws { BusinessError } 21900006 - Task removed or not found.\n         * @syscap SystemCapability.Request.FileTransferAgent\n         * @since 10\n         */\n        /**\n         * Touches specified task with token.\n         * Queries the task details based on the task ID and token.\n         *\n         * @param { string } id the task id.\n         * @param { string } token the in-application isolation key, length between 8 and 2048 bytes.\n         * @param { AsyncCallback<TaskInfo> } callback callback function with a `TaskInfo` argument for informations of the current task.\n         * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Missing mandatory parameters.\n         * <br>2. Incorrect parameter type. 3. Parameter verification failed.\n         * @throws { BusinessError } 13400003 - Task service ability error.\n         * @throws { BusinessError } 21900006 - Task removed or not found.\n         * @syscap SystemCapability.Request.FileTransferAgent\n         * @crossplatform\n         * @since 11\n         */\n        function touch(id: string, token: string, callback: AsyncCallback<TaskInfo>): void;\n        /**\n         * Touches specified task with token.\n         * Queries the task details based on the task ID and token.\n         *\n         * @param { string } id the task id.\n         * @param { string } token the in-application isolation key, length between 8 and 2048 bytes.\n         * @returns { Promise<TaskInfo> } the promise returned by the function.\n         * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Missing mandatory parameters.\n         * <br>2. Incorrect parameter type. 3. Parameter verification failed.\n         * @throws { BusinessError } 13400003 - Task service ability error.\n         * @throws { BusinessError } 21900006 - Task removed or not found.\n         * @syscap SystemCapability.Request.FileTransferAgent\n         * @since 10\n         */\n        /**\n         * Touches specified task with token.\n         * Queries the task details based on the task ID and token.\n         *\n         * @param { string } id the task id.\n         * @param { string } token the in-application isolation key, length between 8 and 2048 bytes.\n         * @returns { Promise<TaskInfo> } the promise returned by the function.\n         * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Missing mandatory parameters.\n         * <br>2. Incorrect parameter type. 3. Parameter verification failed.\n         * @throws { BusinessError } 13400003 - Task service ability error.\n         * @throws { BusinessError } 21900006 - Task removed or not found.\n         * @syscap SystemCapability.Request.FileTransferAgent\n         * @crossplatform\n         * @since 11\n         */\n        function touch(id: string, token: string): Promise<TaskInfo>;\n        /**\n         * Searches tasks, for system.\n         * Searches for task IDs based on Filter.\n         *\n         * @param { AsyncCallback<Array<string>> } callback callback function with a `Array<string>` argument contains task ids match filter.\n         * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter type.\n         * <br>2. Parameter verification failed.\n         * @throws { BusinessError } 13400003 - Task service ability error.\n         * @syscap SystemCapability.Request.FileTransferAgent\n         * @since 10\n         */\n        /**\n         * Searches tasks, for system.\n         * Searches for task IDs based on Filter.\n         *\n         * @param { AsyncCallback<Array<string>> } callback callback function with a `Array<string>` argument contains task ids match filter.\n         * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter type.\n         * <br>2. Parameter verification failed.\n         * @throws { BusinessError } 13400003 - Task service ability error.\n         * @syscap SystemCapability.Request.FileTransferAgent\n         * @crossplatform\n         * @since 11\n         */\n        function search(callback: AsyncCallback<Array<string>>): void;\n        /**\n         * Searches tasks, for system.\n         * Searches for task IDs based on Filter.\n         *\n         * @param { Filter } filter an instance of `Filter`.\n         * @param { AsyncCallback<Array<string>> } callback callback function with a `Array<string>` argument contains task ids match filter.\n         * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter type.\n         * <br>2. Parameter verification failed.\n         * @throws { BusinessError } 13400003 - Task service ability error.\n         * @syscap SystemCapability.Request.FileTransferAgent\n         * @since 10\n         */\n        /**\n         * Searches tasks, for system.\n         * Searches for task IDs based on Filter.\n         *\n         * @param { Filter } filter an instance of `Filter`.\n         * @param { AsyncCallback<Array<string>> } callback callback function with a `Array<string>` argument contains task ids match filter.\n         * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter type.\n         * <br>2. Parameter verification failed.\n         * @throws { BusinessError } 13400003 - Task service ability error.\n         * @syscap SystemCapability.Request.FileTransferAgent\n         * @crossplatform\n         * @since 11\n         */\n        function search(filter: Filter, callback: AsyncCallback<Array<string>>): void;\n        /**\n         * Searches tasks, for system.\n         * Searches for task IDs based on Filter.\n         *\n         * @param { Filter } filter an instance of `Filter`.\n         * @returns { Promise<Array<string>> } the promise returned by the function.\n         * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter type.\n         * <br>2. Parameter verification failed.\n         * @throws { BusinessError } 13400003 - Task service ability error.\n         * @syscap SystemCapability.Request.FileTransferAgent\n         * @since 10\n         */\n        /**\n         * Searches tasks, for system.\n         * Searches for task IDs based on Filter.\n         *\n         * @param { Filter } filter an instance of `Filter`.\n         * @returns { Promise<Array<string>> } the promise returned by the function.\n         * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter type.\n         * <br>2. Parameter verification failed.\n         * @throws { BusinessError } 13400003 - Task service ability error.\n         * @syscap SystemCapability.Request.FileTransferAgent\n         * @crossplatform\n         * @since 11\n         */\n        function search(filter?: Filter): Promise<Array<string>>;\n        /**\n         * Describes group configuration options for download tasks.\n         *\n         * @typedef GroupConfig\n         * @syscap SystemCapability.Request.FileTransferAgent\n         * @since 15\n         */\n        interface GroupConfig {\n            /**\n             * Sets display strategy for background task notifications.\n             * If true, progress, completed, and failed notifications will be displayed.\n             * If false, only completed or failed notifications will be displayed.\n             * The default value is false.\n             *\n             * @type { ?boolean }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 15\n             */\n            gauge?: boolean;\n            /**\n             * Customizes the notification of the task group.\n             *\n             * @type { Notification }\n             * @syscap SystemCapability.Request.FileTransferAgent\n             * @since 15\n             */\n            notification: Notification;\n        }\n        /**\n         * Creates a background download task notification group.\n         * Creates a group based on GroupConfig and returns the group ID.\n         *\n         * @param { GroupConfig } config - config of the group.\n         * @returns { Promise<string> } the gid of the group.\n         * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Missing mandatory parameters.\n         * <br>2. Incorrect parameter type. 3. Parameter verification failed.\n         * @throws { BusinessError } 13400003 - Task service ability error.\n         * @syscap SystemCapability.Request.FileTransferAgent\n         * @since 15\n         */\n        function createGroup(config: GroupConfig): Promise<string>;\n        /**\n         * Attaches multiple download task IDs to a specified group ID.\n         * If any task ID does not meet the attachment conditions,\n         * all tasks in the list will not be added to the group.\n         *\n         * @param { string } gid - the gid of the target group.\n         * @param { string[] } tids - the tid list of tasks to be attached.\n         * @returns { Promise<void> } the promise returned by the function.\n         * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Missing mandatory parameters.\n         * <br>2. Incorrect parameter type. 3. Parameter verification failed.\n         * @throws { BusinessError } 13400003 - Task service ability error.\n         * @throws { BusinessError } 21900005 - Operation with wrong task mode.\n         * @throws { BusinessError } 21900006 - Task removed or not found.\n         * @throws { BusinessError } 21900007 - Operation with wrong task state.\n         * @throws { BusinessError } 21900008 - Group deleted or not found.\n         * @syscap SystemCapability.Request.FileTransferAgent\n         * @since 15\n         */\n        function attachGroup(gid: string, tids: string[]): Promise<void>;\n        /**\n         * Deletes the target group, no more new tasks can be added to this group.\n         * If all tasks in this group end, completed or failed notifications will be displayed.\n         *\n         * @param { string } gid - the gid of the target group.\n         * @returns { Promise<void> } the promise returned by the function.\n         * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Missing mandatory parameters.\n         * <br>2. Incorrect parameter type. 3. Parameter verification failed.\n         * @throws { BusinessError } 13400003 - Task service ability error.\n         * @throws { BusinessError } 21900008 - Group deleted or not found.\n         * @syscap SystemCapability.Request.FileTransferAgent\n         * @since 15\n         */\n        function deleteGroup(gid: string): Promise<void>;\n    }\n}\nexport default request;\n",
}
export default FILE;